Class: ActionController::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/wechat-rails.rb

Class Method Summary collapse

Class Method Details

.wechat_responder(opts = {}) ⇒ Object



40
41
42
43
44
45
46
47
48
49
# File 'lib/wechat-rails.rb', line 40

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