Class: CentrumFaktur::API::Customer

Inherits:
Base
  • Object
show all
Defined in:
lib/centrum_faktur/api/customer.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from CentrumFaktur::API::Base

Instance Method Details

#create(params) ⇒ Object



15
16
17
18
# File 'lib/centrum_faktur/api/customer.rb', line 15

def create(params)
  request = connection.post("/api/1.0/customers/", params)
  request.handle_response
end

#destroy(customer_uri) ⇒ Object



25
26
27
28
# File 'lib/centrum_faktur/api/customer.rb', line 25

def destroy(customer_uri)
  request = connection.delete(customer_uri)
  request.handle_response
end

#list(options = {}) ⇒ Object



5
6
7
8
# File 'lib/centrum_faktur/api/customer.rb', line 5

def list(options = {})
  request = connection.get("/api/1.0/customers/", options)
  request.handle_response
end

#show(customer_uri, options = {}) ⇒ Object



10
11
12
13
# File 'lib/centrum_faktur/api/customer.rb', line 10

def show(customer_uri, options = {})
  request = connection.get(customer_uri, options)
  request.handle_response
end

#update(customer_uri, params) ⇒ Object



20
21
22
23
# File 'lib/centrum_faktur/api/customer.rb', line 20

def update(customer_uri, params)
  request = connection.put(customer_uri, params)
  request.handle_response
end