Class: GramV1Client::JsonFormatter

Inherits:
Object
  • Object
show all
Includes:
ActiveResource::Formats::JsonFormat
Defined in:
lib/gram_v1_client/json_formater.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection_name) ⇒ JsonFormatter

Returns a new instance of JsonFormatter.



8
9
10
# File 'lib/gram_v1_client/json_formater.rb', line 8

def initialize(collection_name)
  @collection_name = collection_name.to_s
end

Instance Attribute Details

#collection_nameObject (readonly)

Returns the value of attribute collection_name.



6
7
8
# File 'lib/gram_v1_client/json_formater.rb', line 6

def collection_name
  @collection_name
end

Instance Method Details

#decode(json) ⇒ Object



12
13
14
# File 'lib/gram_v1_client/json_formater.rb', line 12

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