Class: ColumnApi::Client
- Inherits:
-
Object
- Object
- ColumnApi::Client
- Defined in:
- lib/column_api/client.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
Instance Method Summary collapse
- #account_numbers ⇒ Object
- #ach_returns ⇒ Object
- #ach_transfers ⇒ Object
- #bank_accounts ⇒ Object
- #connection ⇒ Object
- #entities ⇒ Object
-
#initialize(api_key:, base_url: BASE_URL, adapter: Faraday.default_adapter) ⇒ Client
constructor
A new instance of Client.
- #wire_transfers ⇒ Object
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
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
5 6 7 |
# File 'lib/column_api/client.rb', line 5 def adapter @adapter end |
#api_key ⇒ Object (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_url ⇒ Object (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_numbers ⇒ Object
21 22 23 |
# File 'lib/column_api/client.rb', line 21 def account_numbers AccountNumberResource.new(self) end |
#ach_returns ⇒ Object
17 18 19 |
# File 'lib/column_api/client.rb', line 17 def ach_returns AchReturnResource.new(self) end |
#ach_transfers ⇒ Object
13 14 15 |
# File 'lib/column_api/client.rb', line 13 def ach_transfers AchTransferResource.new(self) end |
#bank_accounts ⇒ Object
25 26 27 |
# File 'lib/column_api/client.rb', line 25 def bank_accounts BankAccountResource.new(self) end |
#connection ⇒ Object
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 |
#entities ⇒ Object
29 30 31 |
# File 'lib/column_api/client.rb', line 29 def entities EntityResource.new(self) end |
#wire_transfers ⇒ Object
33 34 35 |
# File 'lib/column_api/client.rb', line 33 def wire_transfers WireTransferResource.new(self) end |