Class: GramV1Client::JsonFormatter
- Inherits:
-
Object
- Object
- GramV1Client::JsonFormatter
- Includes:
- ActiveResource::Formats::JsonFormat
- Defined in:
- lib/gram_v1_client/json_formater.rb
Instance Attribute Summary collapse
-
#collection_name ⇒ Object
readonly
Returns the value of attribute collection_name.
Instance Method Summary collapse
- #decode(json) ⇒ Object
-
#initialize(collection_name) ⇒ JsonFormatter
constructor
A new instance of JsonFormatter.
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_name ⇒ Object (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 |