Class: Chartmogul::V1::Customers::Attributes
- Inherits:
-
Chartmogul::V1::Customers
- Object
- Struct
- Base
- Chartmogul::V1::Customers
- Chartmogul::V1::Customers::Attributes
- Defined in:
- lib/chartmogul/v1/customers.rb
Constant Summary
Constants inherited from Chartmogul::V1::Customers
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create(customer_id, **options) ⇒ Object
Public: Create Custom Attributes for a Customer.
-
#update(customer_id, **options) ⇒ Object
Public: Update Custom Attributes of a Customer.
Methods inherited from Chartmogul::V1::Customers
Instance Method Details
#create(customer_id, **options) ⇒ Object
Public: Create Custom Attributes for a Customer
See: dev.chartmogul.com/docs/create-custom-attributes-for-customer
customer_id - The String/Integer ChartMogul ID of the customer.
Specified as part of the URL.
options - The Hash options used to create a Attribute (default: {}):
:type - The String data type of the custom attribute.
Can be String, Integer, Timestamp or Boolean.
:key - The String key of the custom attribute.
Accepts alphanumeric characters and underscores.
:value - The value of the custom attribute.
Should be of the data type as specified in *type*.
Returns the instance of Chartmogul::V1::Request.
29 30 31 |
# File 'lib/chartmogul/v1/customers.rb', line 29 def create(customer_id, **) Chartmogul::V1::Request.new "#{BASE_URI}/#{customer_id}/attributes/custom", .merge(method: :post, userpwd: client.userpwd) end |
#update(customer_id, **options) ⇒ Object
Public: Update Custom Attributes of a Customer.
See: dev.chartmogul.com/docs/update-custom-attributes-of-customer
customer_id - The String/Integer ChartMogul ID of the customer.
Specified as part of the URL.
options - The Hash options used to refine the Customer attributes (default: {}).
Returns the instance of Chartmogul::V1::Request.
42 43 44 |
# File 'lib/chartmogul/v1/customers.rb', line 42 def update(customer_id, **) Chartmogul::V1::Request.new "#{BASE_URI}/#{customer_id}/attributes/custom", .merge(method: :put, userpwd: client.userpwd) end |