Class: Button::Accounts
- Defined in:
- lib/button/resources/accounts.rb
Overview
Constant Summary
Constants inherited from Resource
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#all ⇒ Button::Response
Gets a list of available accounts.
- #path(account_id = nil) ⇒ Object
-
#transactions(account_id, opts = {}) ⇒ Button::Response
Gets a list of transactions for an account.
Methods inherited from Resource
#api_delete, #api_get, #api_post, #initialize, #timeout
Constructor Details
This class inherits a constructor from Button::Resource
Instance Method Details
#all ⇒ Button::Response
Gets a list of available accounts
16 17 18 |
# File 'lib/button/resources/accounts.rb', line 16 def all api_get(path) end |
#path(account_id = nil) ⇒ Object
7 8 9 10 |
# File 'lib/button/resources/accounts.rb', line 7 def path(account_id = nil) return "/v1/affiliation/accounts/#{account_id}/transactions" if account_id '/v1/affiliation/accounts' end |
#transactions(account_id, opts = {}) ⇒ Button::Response
Gets a list of transactions for an account
30 31 32 33 34 35 36 37 |
# File 'lib/button/resources/accounts.rb', line 30 def transactions(account_id, opts = {}) query = {} query['cursor'] = opts[:cursor] if opts[:cursor] query['start'] = opts[:start] if opts[:start] query['end'] = opts[:end] if opts[:end] api_get(path(account_id), query) end |