Class: Zazu::Resources::Accounts
- Defined in:
- lib/zazu/resources/accounts.rb
Overview
Accounts and their transactions.
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get(id) ⇒ Object
GET /api/accounts/:id.
-
#get_transaction(account_id, transaction_id) ⇒ Object
GET /api/accounts/:account_id/transactions/:id.
-
#list(status: nil, currency_code: nil, limit: MAX_PER_PAGE, cursor: nil) ⇒ Zazu::Page
GET /api/accounts.
-
#list_transactions(account_id, operation: nil, posted_after: nil, posted_before: nil, limit: MAX_PER_PAGE, cursor: nil) ⇒ Object
GET /api/accounts/:account_id/transactions.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Zazu::Resources::Base
Instance Method Details
#get(id) ⇒ Object
GET /api/accounts/:id
25 26 27 |
# File 'lib/zazu/resources/accounts.rb', line 25 def get(id) http_get(encode_path("api/accounts", id)) end |
#get_transaction(account_id, transaction_id) ⇒ Object
GET /api/accounts/:account_id/transactions/:id
47 48 49 |
# File 'lib/zazu/resources/accounts.rb', line 47 def get_transaction(account_id, transaction_id) http_get(encode_path("api/accounts", account_id, "transactions", transaction_id)) end |
#list(status: nil, currency_code: nil, limit: MAX_PER_PAGE, cursor: nil) ⇒ Zazu::Page
GET /api/accounts
14 15 16 17 18 19 20 21 22 |
# File 'lib/zazu/resources/accounts.rb', line 14 def list(status: nil, currency_code: nil, limit: MAX_PER_PAGE, cursor: nil) list_page( "api/accounts", status: status, currency_code: currency_code, limit: limit, cursor: cursor ) end |
#list_transactions(account_id, operation: nil, posted_after: nil, posted_before: nil, limit: MAX_PER_PAGE, cursor: nil) ⇒ Object
GET /api/accounts/:account_id/transactions
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/zazu/resources/accounts.rb', line 34 def list_transactions(account_id, operation: nil, posted_after: nil, posted_before: nil, limit: MAX_PER_PAGE, cursor: nil) list_page( encode_path("api/accounts", account_id, "transactions"), operation: operation, posted_after: serialize_time(posted_after), posted_before: serialize_time(posted_before), limit: limit, cursor: cursor ) end |