Class: ChartMogul::Enrichment::DeprecatedCustomer
Overview
DEPRECATED: Please use ChartMogul/Customer instead.
Class Method Summary
collapse
Instance Method Summary
collapse
#update!
#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
88
89
90
|
# File 'lib/chartmogul/enrichment/customer.rb', line 88
def self.all(options = {})
Customers.all(options)
end
|
.retrieve(uuid) ⇒ Object
84
85
86
|
# File 'lib/chartmogul/enrichment/customer.rb', line 84
def self.retrieve(uuid)
custom!(:get, "/v1/customers/#{uuid}")
end
|
.search(email) ⇒ Object
92
93
94
|
# File 'lib/chartmogul/enrichment/customer.rb', line 92
def self.search(email)
Customers.search(email)
end
|
Instance Method Details
#add_custom_attributes!(*custom_attrs) ⇒ Object
57
58
59
60
61
|
# File 'lib/chartmogul/enrichment/customer.rb', line 57
def add_custom_attributes!(*custom_attrs)
self.custom_attributes = custom_without_assign!(:post,
"/v1/customers/#{uuid}/attributes/custom",
custom: custom_attrs)[:custom]
end
|
45
46
47
48
49
|
# File 'lib/chartmogul/enrichment/customer.rb', line 45
def add_tags!(*tags)
self.tags = custom_without_assign!(:post,
"/v1/customers/#{uuid}/attributes/tags",
tags: tags)[:tags]
end
|
#custom_attributes ⇒ Object
41
42
43
|
# File 'lib/chartmogul/enrichment/customer.rb', line 41
def custom_attributes
@attributes[:custom]
end
|
#merge_into!(other_customer) ⇒ Object
75
76
77
78
79
80
81
82
|
# File 'lib/chartmogul/enrichment/customer.rb', line 75
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
69
70
71
72
73
|
# File 'lib/chartmogul/enrichment/customer.rb', line 69
def remove_custom_attributes!(*custom_attrs)
self.custom_attributes = custom_without_assign!(:delete,
"/v1/customers/#{uuid}/attributes/custom",
custom: custom_attrs)[:custom]
end
|
51
52
53
54
55
|
# File 'lib/chartmogul/enrichment/customer.rb', line 51
def remove_tags!(*tags)
self.tags = custom_without_assign!(:delete,
"/v1/customers/#{uuid}/attributes/tags",
tags: tags)[:tags]
end
|
37
38
39
|
# File 'lib/chartmogul/enrichment/customer.rb', line 37
def tags
@attributes[:tags]
end
|
#update_custom_attributes!(custom_attrs = {}) ⇒ Object
63
64
65
66
67
|
# File 'lib/chartmogul/enrichment/customer.rb', line 63
def update_custom_attributes!(custom_attrs = {})
self.custom_attributes = custom_without_assign!(:put,
"/v1/customers/#{uuid}/attributes/custom",
custom: custom_attrs)[:custom]
end
|