Class: ColumnApi::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/column_api/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, base_url: BASE_URL, adapter: Faraday.default_adapter) ⇒ Client

Returns a new instance of Client.



7
8
9
10
11
# File 'lib/column_api/client.rb', line 7

def initialize(api_key:, base_url: BASE_URL, adapter: Faraday.default_adapter)
  @api_key = api_key
  @base_url = base_url
  @adapter = adapter
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



5
6
7
# File 'lib/column_api/client.rb', line 5

def adapter
  @adapter
end

#api_keyObject (readonly)

Returns the value of attribute api_key.



5
6
7
# File 'lib/column_api/client.rb', line 5

def api_key
  @api_key
end

#base_urlObject (readonly)

Returns the value of attribute base_url.



5
6
7
# File 'lib/column_api/client.rb', line 5

def base_url
  @base_url
end

Instance Method Details

#account_numbersObject



21
22
23
# File 'lib/column_api/client.rb', line 21

def 
  AccountNumberResource.new(self)
end

#ach_returnsObject



17
18
19
# File 'lib/column_api/client.rb', line 17

def ach_returns
  AchReturnResource.new(self)
end

#ach_transfersObject



13
14
15
# File 'lib/column_api/client.rb', line 13

def ach_transfers
  AchTransferResource.new(self)
end

#bank_accountsObject



25
26
27
# File 'lib/column_api/client.rb', line 25

def bank_accounts
  BankAccountResource.new(self)
end

#connectionObject



37
38
39
40
41
42
43
44
45
# File 'lib/column_api/client.rb', line 37

def connection
  @connection ||= Faraday.new(BASE_URL) do |conn|
    conn.request :authorization, :basic, "", api_key
    conn.request :json

    conn.response :parse_dates
    conn.response :json, content_type: "application/json"
  end
end

#entitiesObject



29
30
31
# File 'lib/column_api/client.rb', line 29

def entities
  EntityResource.new(self)
end

#wire_transfersObject



33
34
35
# File 'lib/column_api/client.rb', line 33

def wire_transfers
  WireTransferResource.new(self)
end