Class: Nestful::Formats::JsonFormat

Inherits:
Format
  • Object
show all
Defined in:
lib/nestful/formats/json_format.rb

Instance Method Summary collapse

Instance Method Details

#decode(json) ⇒ Object



19
20
21
# File 'lib/nestful/formats/json_format.rb', line 19

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

#encode(hash, options = nil) ⇒ Object



15
16
17
# File 'lib/nestful/formats/json_format.rb', line 15

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

#extensionObject



7
8
9
# File 'lib/nestful/formats/json_format.rb', line 7

def extension
  "json"
end

#mime_typeObject



11
12
13
# File 'lib/nestful/formats/json_format.rb', line 11

def mime_type
  "application/json"
end