Class: KlaviyoAPI::JsonFormatter
- Inherits:
-
Object
- Object
- KlaviyoAPI::JsonFormatter
- Includes:
- ActiveResource::Formats::JsonFormat
- Defined in:
- lib/klaviyo_api/json_formatter.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.
9 10 11 |
# File 'lib/klaviyo_api/json_formatter.rb', line 9 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.
7 8 9 |
# File 'lib/klaviyo_api/json_formatter.rb', line 7 def collection_name @collection_name end |
Instance Method Details
#decode(json) ⇒ Object
13 14 15 |
# File 'lib/klaviyo_api/json_formatter.rb', line 13 def decode(json) ActiveSupport::JSON.decode json.presence end |