Class: InvestecOpenApi::Client
- Inherits:
-
Object
- Object
- InvestecOpenApi::Client
- Defined in:
- lib/investec_open_api/client.rb
Constant Summary collapse
- INVESTEC_API_URL =
"https://openapi.investec.com/"
Instance Method Summary collapse
Instance Method Details
#accounts ⇒ Object
13 14 15 16 17 18 |
# File 'lib/investec_open_api/client.rb', line 13 def accounts response = connection.get("za/pb/v1/accounts") response.body["data"]["accounts"].map do |account_raw| InvestecOpenApi::Models::Account.from_api(account_raw) end end |
#authenticate! ⇒ Object
9 10 11 |
# File 'lib/investec_open_api/client.rb', line 9 def authenticate! @token = get_oauth_token["access_token"] end |
#transactions(account_id) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/investec_open_api/client.rb', line 20 def transactions(account_id) response = connection.get("za/pb/v1/accounts/#{account_id}/transactions") response.body["data"]["transactions"].map do |transaction_raw| InvestecOpenApi::Models::Transaction.from_api(transaction_raw) end end |