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
22 23 24 25 |
# File 'lib/active_resource/formats/json_format.rb', line 22 def decode(json) return nil if json.nil? Formats.remove_root(ActiveSupport::JSON.decode(json)) end |
#encode(hash, options = nil) ⇒ Object
18 19 20 |
# File 'lib/active_resource/formats/json_format.rb', line 18 def encode(hash, = nil) ActiveSupport::JSON.encode(hash, ) end |
#extension ⇒ Object
10 11 12 |
# File 'lib/active_resource/formats/json_format.rb', line 10 def extension "json" end |
#mime_type ⇒ Object
14 15 16 |
# File 'lib/active_resource/formats/json_format.rb', line 14 def mime_type "application/json" end |