Class: Button::Customers
- Defined in:
- lib/button/resources/customers.rb
Overview
Constant Summary
Constants inherited from Resource
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#create(customer) ⇒ Button::Response
Create a Customer.
-
#get(customer_id) ⇒ Button::Response
Gets a customer.
- #path(customer_id = nil) ⇒ Object
Methods inherited from Resource
#api_delete, #api_get, #api_post, #initialize, #timeout
Constructor Details
This class inherits a constructor from Button::Resource
Instance Method Details
#create(customer) ⇒ Button::Response
Create a Customer
26 27 28 |
# File 'lib/button/resources/customers.rb', line 26 def create(customer) api_post(path, customer) end |
#get(customer_id) ⇒ Button::Response
Gets a customer
17 18 19 |
# File 'lib/button/resources/customers.rb', line 17 def get(customer_id) api_get(path(customer_id)) end |
#path(customer_id = nil) ⇒ Object
7 8 9 10 |
# File 'lib/button/resources/customers.rb', line 7 def path(customer_id = nil) return "/v1/customers/#{customer_id}" if customer_id '/v1/customers' end |