Module: ActiveResource::Formats::JsonFormat

Extended by:
JsonFormat
Included in:
JsonFormat
Defined in:
activeresource/lib/active_resource/formats/json_format.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) decode(json)



20
21
22
# File 'activeresource/lib/active_resource/formats/json_format.rb', line 20

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

- (Object) encode(hash, options = nil)



16
17
18
# File 'activeresource/lib/active_resource/formats/json_format.rb', line 16

def encode(hash, options = nil)
  ActiveSupport::JSON.encode(hash, options)
end

- (Object) extension



8
9
10
# File 'activeresource/lib/active_resource/formats/json_format.rb', line 8

def extension
  "json"
end

- (Object) mime_type



12
13
14
# File 'activeresource/lib/active_resource/formats/json_format.rb', line 12

def mime_type
  "application/json"
end