Class: BigCommerce::ManagementAPI::Customers
- Defined in:
- lib/big_commerce/management_api/customers.rb
Defined Under Namespace
Classes: Addresses, AttributeValues, Attributes, Metafields
Constant Summary collapse
- PATH =
"customers"
- RESULT_INSTANCE =
Customer
Constants inherited from Endpoint
Endpoint::CONTENT_TYPE, Endpoint::CONTENT_TYPE_JSON, Endpoint::HOST, Endpoint::JSON_CONTENT_TYPES, Endpoint::PORT, Endpoint::RESULT_KEY, Endpoint::USER_AGENT
Instance Attribute Summary collapse
-
#addresses ⇒ Object
readonly
Returns the value of attribute addresses.
-
#attribute_values ⇒ Object
readonly
Returns the value of attribute attribute_values.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#metafields ⇒ Object
readonly
Returns the value of attribute metafields.
Instance Method Summary collapse
- #create(*customers) ⇒ Object
- #delete(*ids) ⇒ Object
- #get(options = {}) ⇒ Object
-
#initialize(*argz) ⇒ Customers
constructor
A new instance of Customers.
- #update(*customers) ⇒ Object
Constructor Details
#initialize(*argz) ⇒ Customers
Returns a new instance of Customers.
141 142 143 144 145 146 147 148 |
# File 'lib/big_commerce/management_api/customers.rb', line 141 def initialize(*argz) super(*argz) @addresses = Addresses.new(*argz) @attributes = Attributes.new(*argz) @attribute_values = AttributeValues.new(*argz) @metafields = Metafields.new(*argz) end |
Instance Attribute Details
#addresses ⇒ Object (readonly)
Returns the value of attribute addresses.
136 137 138 |
# File 'lib/big_commerce/management_api/customers.rb', line 136 def addresses @addresses end |
#attribute_values ⇒ Object (readonly)
Returns the value of attribute attribute_values.
136 137 138 |
# File 'lib/big_commerce/management_api/customers.rb', line 136 def attribute_values @attribute_values end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
136 137 138 |
# File 'lib/big_commerce/management_api/customers.rb', line 136 def attributes @attributes end |
#metafields ⇒ Object (readonly)
Returns the value of attribute metafields.
136 137 138 |
# File 'lib/big_commerce/management_api/customers.rb', line 136 def @metafields end |
Instance Method Details
#create(*customers) ⇒ Object
150 151 152 153 154 |
# File 'lib/big_commerce/management_api/customers.rb', line 150 def create(*customers) customers.flatten! POST(PATH, customers.map(&:to_h)) end |
#delete(*ids) ⇒ Object
156 157 158 159 160 161 162 163 |
# File 'lib/big_commerce/management_api/customers.rb', line 156 def delete(*ids) ids.flatten! DELETE( PATH, with_in_param({:id => ids}, :id) ) end |
#get(options = {}) ⇒ Object
165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/big_commerce/management_api/customers.rb', line 165 def get( = {}) GET( PATH, with_in_param( , :company, :customer_group_id, :email, :id, :name, :registration_ip_address ) ) end |
#update(*customers) ⇒ Object
180 181 182 183 184 |
# File 'lib/big_commerce/management_api/customers.rb', line 180 def update(*customers) customers.flatten! PUT(PATH, customers.map(&:to_h)) end |