Class: Chatwork::FormToJsonParser

Inherits:
Object
  • Object
show all
Includes:
ActiveResource::Formats::JsonFormat
Defined in:
lib/chatwork/base.rb

Overview

Chatwork API用のフォーマッター

送信は‘x-www-form-urlencoded`に対しデコードは`application/json`という特殊な要件を吸収するために実装した。Chatwork以外で使用するケースはないと判断しここに置いている

Instance Method Summary collapse

Instance Method Details

#decode(json) ⇒ Object



19
20
21
# File 'lib/chatwork/base.rb', line 19

def decode(json)
  ActiveSupport::JSON.decode(json)
end

#mime_typeObject



15
16
17
# File 'lib/chatwork/base.rb', line 15

def mime_type
  'application/x-www-form-urlencoded'
end