Class: Atrium::Account
- Inherits:
-
Object
- Object
- Atrium::Account
- Includes:
- ActiveAttr::Model
- Defined in:
- lib/atrium/account.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.list(user_guid:) ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/atrium/account.rb', line 35 def self.list(user_guid:) endpoint = "/users/#{user_guid}/accounts" accounts_response = ::Atrium.client.make_request(:get, endpoint) accounts = accounts_response["accounts"].map do |account| ::Atrium::Account.new(account) end end |
.read(user_guid:, account_guid:) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/atrium/account.rb', line 44 def self.read(user_guid:, account_guid:) endpoint = "/users/#{user_guid}/accounts/#{account_guid}" account_response = ::Atrium.client.make_request(:get, endpoint) account_params = account_response["account"] ::Atrium::Account.new(account_params) end |
Instance Method Details
#transactions ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'lib/atrium/account.rb', line 52 def transactions endpoint = "/users/#{self.user_guid}/accounts/#{self.guid}/transactions" account_transactions_response = ::Atrium.client.make_request(:get, endpoint) transactions = account_transactions_response["transactions"].map do |transaction| ::Atrium::Transaction.new(transaction) end end |