Class: Finicity::V1::Request::GetCustomers

Inherits:
Object
  • Object
show all
Extended by:
HTTPClient::IncludeClient
Includes:
Logger
Defined in:
lib/finicity/v1/request/get_customers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logger

#log_request, #mask_body

Constructor Details

#initialize(token) ⇒ GetCustomers

Instance Methods



18
19
20
# File 'lib/finicity/v1/request/get_customers.rb', line 18

def initialize(token)
  @token = token
end

Instance Attribute Details

#tokenObject

Attributes



13
14
15
# File 'lib/finicity/v1/request/get_customers.rb', line 13

def token
  @token
end

Instance Method Details

#get_customers(start, limit) ⇒ Object



22
23
24
25
# File 'lib/finicity/v1/request/get_customers.rb', line 22

def get_customers(start, limit)
  query = { :start => start, :limit => limit }
  http_client.get(url, query, headers)
end

#headersObject



27
28
29
30
31
32
# File 'lib/finicity/v1/request/get_customers.rb', line 27

def headers
  {
    'Finicity-App-Key' => ::Finicity.config.app_key,
    'Finicity-App-Token' => token
  }
end

#urlObject



34
35
36
37
38
39
40
# File 'lib/finicity/v1/request/get_customers.rb', line 34

def url
  ::URI.join(
    ::Finicity.config.base_url,
    'v1/',
    'customers'
  )
end