Class: Chatwork::Base
- Inherits:
-
ActiveResource::Base
- Object
- ActiveResource::Base
- Chatwork::Base
- Defined in:
- lib/chatwork/base.rb
Overview
ChatworkのAPI通信をする際の基底クラス
APIキーの設定やフォーマッタの設定など、共通で必要な設定をここで行うChatwork APIを扱う際にはこのクラスを継承すること
Instance Method Summary collapse
Instance Method Details
#to_json(options = {}) ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/chatwork/base.rb', line 36 def to_json( = {}) json = if include_root_in_json super({ root: self.class.element_name }.merge()) else super() end hash = JSON.parse(json) URI.encode_www_form(hash) end |