Class: ChartMogul::Enrichment::DeprecatedCustomer
Overview
DEPRECATED: Please use ChartMogul/Customer instead.
Constant Summary
Constants inherited
from APIResource
APIResource::BACKOFF_FACTOR, APIResource::INTERVAL, APIResource::INTERVAL_RANDOMNESS, APIResource::MAX_INTERVAL, APIResource::RETRY_EXCEPTIONS, APIResource::RETRY_STATUSES
Class Method Summary
collapse
Instance Method Summary
collapse
#update!
included
#custom!, #custom_without_assign!, included
Methods inherited from APIResource
connection, handle_other_error, handle_request_error, handling_errors, set_resource_name, set_resource_path, set_resource_root_key
Class Method Details
.all(options = {}) ⇒ Object
83
84
85
|
# File 'lib/chartmogul/enrichment/customer.rb', line 83
def self.all(options = {})
Customers.all(options)
end
|
.search(email) ⇒ Object
87
88
89
|
# File 'lib/chartmogul/enrichment/customer.rb', line 87
def self.search(email)
Customers.search(email)
end
|
Instance Method Details
#add_custom_attributes!(*custom_attrs) ⇒ Object
56
57
58
59
60
|
# File 'lib/chartmogul/enrichment/customer.rb', line 56
def add_custom_attributes!(*custom_attrs)
self.custom_attributes = custom_without_assign!(:post,
"/v1/customers/#{uuid}/attributes/custom",
custom: custom_attrs)[:custom]
end
|
44
45
46
47
48
|
# File 'lib/chartmogul/enrichment/customer.rb', line 44
def add_tags!(*tags)
self.tags = custom_without_assign!(:post,
"/v1/customers/#{uuid}/attributes/tags",
tags: tags)[:tags]
end
|
#custom_attributes ⇒ Object
40
41
42
|
# File 'lib/chartmogul/enrichment/customer.rb', line 40
def custom_attributes
@attributes[:custom]
end
|
#merge_into!(other_customer) ⇒ Object
74
75
76
77
78
79
80
81
|
# File 'lib/chartmogul/enrichment/customer.rb', line 74
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) ⇒ Object
68
69
70
71
72
|
# File 'lib/chartmogul/enrichment/customer.rb', line 68
def remove_custom_attributes!(*custom_attrs)
self.custom_attributes = custom_without_assign!(:delete,
"/v1/customers/#{uuid}/attributes/custom",
custom: custom_attrs)[:custom]
end
|
50
51
52
53
54
|
# File 'lib/chartmogul/enrichment/customer.rb', line 50
def remove_tags!(*tags)
self.tags = custom_without_assign!(:delete,
"/v1/customers/#{uuid}/attributes/tags",
tags: tags)[:tags]
end
|
36
37
38
|
# File 'lib/chartmogul/enrichment/customer.rb', line 36
def tags
@attributes[:tags]
end
|
#update_custom_attributes!(custom_attrs = {}) ⇒ Object
62
63
64
65
66
|
# File 'lib/chartmogul/enrichment/customer.rb', line 62
def update_custom_attributes!(custom_attrs = {})
self.custom_attributes = custom_without_assign!(:put,
"/v1/customers/#{uuid}/attributes/custom",
custom: custom_attrs)[:custom]
end
|