Module: ActionController::WechatResponder
Instance Method Summary collapse
- #wechat(account = nil) ⇒ Object
- #wechat_api(opts = {}) ⇒ Object
- #wechat_responder(opts = {}) ⇒ Object
Instance Method Details
#wechat(account = nil) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/action_controller/wechat_responder.rb', line 18 def wechat(account = nil) if account && account != wechat_cfg_account Wechat.api(account) else self.wechat_api_client ||= load_controller_wechat(wechat_cfg_account) end end |
#wechat_api(opts = {}) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/action_controller/wechat_responder.rb', line 3 def wechat_api(opts = {}) include Wechat::ControllerApi account = opts.delete(:account) self.wechat_cfg_account = account ? account.to_sym : :default self.wechat_api_client = load_controller_wechat(wechat_cfg_account, opts) end |
#wechat_responder(opts = {}) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/action_controller/wechat_responder.rb', line 10 def wechat_responder(opts = {}) include Wechat::Responder account = opts.delete(:account) self.account_from_request = opts.delete(:account_from_request) self.wechat_cfg_account = account ? account.to_sym : :default self.wechat_api_client = load_controller_wechat(wechat_cfg_account, opts) end |