Class: KlaviyoAPI::JsonFormatter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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