class Object

Public Instance Methods

reply() click to toggle source
# File lib/generators/templates/qy_wechat_controller.rb, line 4
def reply
  render xml: send("response_#{@weixin_message.MsgType}_message", {})
end
response_event_message(options={}) click to toggle source

用于响应事件

# File lib/generators/templates/qy_wechat_controller.rb, line 31
def response_event_message(options={})
  generate_text_message("响应事件")
end
response_image_message(options={}) click to toggle source

image消息

# File lib/generators/templates/qy_wechat_controller.rb, line 16
def response_image_message(options={})
  generate_image_message(new_image(@weixin_message.MediaId))
end
response_text_message(options={}) click to toggle source

text消息

# File lib/generators/templates/qy_wechat_controller.rb, line 11
def response_text_message(options={})
  generate_text_message("Your Message: #{@keyword}")
end
response_video_message(options={}) click to toggle source

video消息

# File lib/generators/templates/qy_wechat_controller.rb, line 26
def response_video_message(options={})
  generate_video_message(new_video(@weixin_message.MediaId, "desc", "title"))
end
response_voice_message(options={}) click to toggle source

voice消息

# File lib/generators/templates/qy_wechat_controller.rb, line 21
def response_voice_message(options={})
  generate_voice_message(new_voice(@weixin_message.MediaId))
end