Class: Inttegro::Resources::Customers

Inherits:
Object
  • Object
show all
Defined in:
lib/inttegro/resources/customers.rb

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ Customers

Returns a new instance of Customers.



7
8
9
# File 'lib/inttegro/resources/customers.rb', line 7

def initialize(http)
  @http = T.let(http, Inttegro::HTTPClient)
end

Instance Method Details

#create(payload) ⇒ Object



11
12
13
# File 'lib/inttegro/resources/customers.rb', line 11

def create(payload)
  @http.post_resource("/customers/create", Inttegro::Customer, :customer, payload)
end

#lookup(customer_id:) ⇒ Object



19
20
21
# File 'lib/inttegro/resources/customers.rb', line 19

def lookup(customer_id:)
  @http.post_resource("/customers/lookup", Inttegro::Customer, :customer, { customer_id: customer_id })
end

#page(payload = {}) ⇒ Object



23
24
25
# File 'lib/inttegro/resources/customers.rb', line 23

def page(payload = {})
  @http.post_resource("/customers/page", Inttegro::CustomerPage, :page, payload || {})
end

#update(payload) ⇒ Object



15
16
17
# File 'lib/inttegro/resources/customers.rb', line 15

def update(payload)
  @http.post_resource("/customers/update", Inttegro::Customer, :customer, payload)
end