Module: ActiveResource::Formats::JsonAPIFormat
- Defined in:
- lib/esp/extensions/active_resource/formats/json_api_format.rb
Class Method Summary collapse
- .decode(json) ⇒ Object
- .encode(hash, options = nil) ⇒ Object
- .extension ⇒ Object
- .mime_type ⇒ Object
Class Method Details
.decode(json) ⇒ Object
39 40 41 42 |
# File 'lib/esp/extensions/active_resource/formats/json_api_format.rb', line 39 def decode(json) # pp ActiveSupport::JSON.decode(json), index: false, indent: -2 Formats.remove_root(parse_json_api(ActiveSupport::JSON.decode(json))) end |
.encode(hash, options = nil) ⇒ Object
35 36 37 |
# File 'lib/esp/extensions/active_resource/formats/json_api_format.rb', line 35 def encode(hash, = nil) ActiveSupport::JSON.encode(hash, ) end |
.extension ⇒ Object
27 28 29 |
# File 'lib/esp/extensions/active_resource/formats/json_api_format.rb', line 27 def extension "json".freeze end |
.mime_type ⇒ Object
31 32 33 |
# File 'lib/esp/extensions/active_resource/formats/json_api_format.rb', line 31 def mime_type "application/vnd.api+json".freeze end |