module QyWechat

Rails::Generators::Base dont need a name Rails::Generators::NamedBase need a name

标准的回包 <xml>

<Encrypt><![CDATA[msg_encrypt]]></Encrypt>
<MsgSignature><![CDATA[msg_signature]]></MsgSignature>
<TimeStamp>timestamp</TimeStamp>
<Nonce><![CDATA[nonce]]></Nonce>

</xml>

Constants

EventMessage

<xml>

<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[FromUser]]></FromUserName>
<CreateTime>123456789</CreateTime>
<MsgType><![CDATA[event]]></MsgType>
<Event><![CDATA[EVENT]]></Event>
<EventKey><![CDATA[EVENTKEY]]></EventKey>

</xml>

ImageMessage

<xml>

<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1348831860</CreateTime>
<MsgType><![CDATA[image]]></MsgType>
<PicUrl><![CDATA[this is a url]]></PicUrl>
<MsgId>1234567890123456</MsgId>

</xml>

LinkMessage

<xml>

<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1351776360</CreateTime>
<MsgType><![CDATA[link]]></MsgType>
<Title><![CDATA[公众平台官网链接]]></Title>
<Description><![CDATA[公众平台官网链接]]></Description>
<Url><![CDATA[url]]></Url>
<MsgId>1234567890123456</MsgId>

</xml>

TextMessage

<xml>

<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1348831860</CreateTime>
<MsgType><![CDATA[text]]></MsgType>
<Content><![CDATA[this is a test]]></Content>
<MsgId>1234567890123456</MsgId>

</xml>

VERSION

Attributes

configuration[RW]

Public Class Methods

config() click to toggle source
# File lib/qy_wechat/configuration.rb, line 7
def config
  self.configuration ||= Configuration.new
end
configure() { |config| ... } click to toggle source
# File lib/qy_wechat/configuration.rb, line 11
def configure
  yield config if block_given?
end
qy_model() click to toggle source
# File lib/qy_wechat/configuration.rb, line 19
def qy_model
  if qy_model_name.blank?
    raise "You need to config `qy_app` in 'config/initializers/qy_wechat_config.rb'"
  end
  @qy_model ||= qy_model_name.to_s.constantize
end
qy_model_name() click to toggle source
# File lib/qy_wechat/configuration.rb, line 15
def qy_model_name
  @qy_model_name ||= QyWechat.config.qy_app
end