Module: ActiveResource::Formats::JsonFormat
- Extended by:
- JsonFormat
- Included in:
- JsonFormat
- Defined in:
- lib/active_resource/formats/json_format.rb
Instance Method Summary collapse
- #decode(json) ⇒ Object
- #encode(hash, options = nil) ⇒ Object
- #extension ⇒ Object
- #mime_type ⇒ Object
Instance Method Details
#decode(json) ⇒ Object
20 21 22 |
# File 'lib/active_resource/formats/json_format.rb', line 20 def decode(json) Formats.remove_root(ActiveSupport::JSON.decode(json)) end |
#encode(hash, options = nil) ⇒ Object
16 17 18 |
# File 'lib/active_resource/formats/json_format.rb', line 16 def encode(hash, = nil) ActiveSupport::JSON.encode(hash, ) end |
#extension ⇒ Object
8 9 10 |
# File 'lib/active_resource/formats/json_format.rb', line 8 def extension "json" end |
#mime_type ⇒ Object
12 13 14 |
# File 'lib/active_resource/formats/json_format.rb', line 12 def mime_type "application/json" end |