Class: Moip2::CustomerApi
- Inherits:
-
Object
- Object
- Moip2::CustomerApi
- Defined in:
- lib/moip2/customer_api.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #base_path ⇒ Object
- #create(customer) ⇒ Object
-
#initialize(client) ⇒ CustomerApi
constructor
A new instance of CustomerApi.
- #show(customer_external_id) ⇒ Object
Constructor Details
#initialize(client) ⇒ CustomerApi
Returns a new instance of CustomerApi.
6 7 8 |
# File 'lib/moip2/customer_api.rb', line 6 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/moip2/customer_api.rb', line 4 def client @client end |
Instance Method Details
#base_path ⇒ Object
10 11 12 |
# File 'lib/moip2/customer_api.rb', line 10 def base_path "/v2/customers" end |
#create(customer) ⇒ Object
18 19 20 |
# File 'lib/moip2/customer_api.rb', line 18 def create(customer) Resource::Customer.new client, client.post(base_path, customer) end |
#show(customer_external_id) ⇒ Object
14 15 16 |
# File 'lib/moip2/customer_api.rb', line 14 def show(customer_external_id) Resource::Customer.new client, client.get("#{base_path}/#{customer_external_id}") end |