Class: BigCommerce::ManagementAPI::Customers::Addresses

Inherits:
Endpoint
  • Object
show all
Defined in:
lib/big_commerce/management_api/customers.rb

Constant Summary collapse

PATH =
"customers/addresses"
RESULT_INSTANCE =
Address

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 Method Summary collapse

Methods inherited from Endpoint

#initialize

Constructor Details

This class inherits a constructor from BigCommerce::ManagementAPI::Endpoint

Instance Method Details

#create(*attributes) ⇒ Object



12
13
14
15
16
# File 'lib/big_commerce/management_api/customers.rb', line 12

def create(*attributes)
  attributes.flatten!

  POST(PATH, attributes.map(&:to_h))
end

#delete(*ids) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/big_commerce/management_api/customers.rb', line 18

def delete(*ids)
  ids.flatten!

  DELETE(
    PATH,
    with_in_param({:id => ids}, :id)
  )
end

#get(options = {}) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/big_commerce/management_api/customers.rb', line 27

def get(options = {})
  GET(
    PATH,
    with_in_param(
      options,
      :company,
      :customer_id,
      :id,
      :name
    )
  )
end