Class: ActionController::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/wechat_public.rb

Class Method Summary collapse

Class Method Details

.wechat_responder(opts = {}) ⇒ Object



48
49
50
51
52
53
54
55
56
57
# File 'lib/wechat_public.rb', line 48

def self.wechat_responder opts={}
  self.send(:include, WechatPublic::Responder)
  if (opts.empty?)
    self.wechat = WechatPublic.api
    self.token = WechatPublic.config.token
  else
    self.wechat = WechatPublic::Api.new(opts[:appid], opts[:secret], opts[:access_token])
    self.token = opts[:token]
  end
end