class ChartMogul::Enrichment::DeprecatedCustomer
DEPRECATED: Please use ChartMogul/Customer
instead.
Public Class Methods
all(options = {})
click to toggle source
# File lib/chartmogul/enrichment/customer.rb, line 85 def self.all(options = {}) Customers.all(options) end
search(email)
click to toggle source
# File lib/chartmogul/enrichment/customer.rb, line 89 def self.search(email) Customers.search(email) end
Public Instance Methods
add_custom_attributes!(*custom_attrs)
click to toggle source
# File lib/chartmogul/enrichment/customer.rb, line 58 def add_custom_attributes!(*custom_attrs) self.custom_attributes = custom_without_assign!(:post, "/v1/customers/#{uuid}/attributes/custom", custom: custom_attrs)[:custom] end
custom_attributes()
click to toggle source
# File lib/chartmogul/enrichment/customer.rb, line 42 def custom_attributes @attributes[:custom] end
merge_into!(other_customer)
click to toggle source
# File lib/chartmogul/enrichment/customer.rb, line 76 def merge_into!(other_customer) options = { from: { customer_uuid: uuid }, into: { customer_uuid: other_customer.uuid } } custom!(:post, '/v1/customers/merges', options) true end
remove_custom_attributes!(*custom_attrs)
click to toggle source
# File lib/chartmogul/enrichment/customer.rb, line 70 def remove_custom_attributes!(*custom_attrs) self.custom_attributes = custom_without_assign!(:delete, "/v1/customers/#{uuid}/attributes/custom", custom: custom_attrs)[:custom] end
update_custom_attributes!(custom_attrs = {})
click to toggle source
# File lib/chartmogul/enrichment/customer.rb, line 64 def update_custom_attributes!(custom_attrs = {}) self.custom_attributes = custom_without_assign!(:put, "/v1/customers/#{uuid}/attributes/custom", custom: custom_attrs)[:custom] end
Private Instance Methods
custom_attributes=(custom_attributes = {})
click to toggle source
When passing timestamps, either use Time instance, or iso8601-parseable string.
# File lib/chartmogul/enrichment/customer.rb, line 100 def custom_attributes=(custom_attributes = {}) @attributes[:custom] = ChartMogul::Utils::JSONParser.typecast_custom_attributes(custom_attributes) end
set_attributes(attributes_attributes)
click to toggle source
# File lib/chartmogul/enrichment/customer.rb, line 104 def set_attributes(attributes_attributes) @attributes = attributes_attributes @attributes[:custom] = ChartMogul::Utils::JSONParser.typecast_custom_attributes(attributes_attributes[:custom]) end