Class: Atrium::Account

Inherits:
Object
  • Object
show all
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 ||
    ::Atrium::Account.new()
  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/#{}"
   = ::Atrium.client.make_request(:get, endpoint)

   = ["account"]
  ::Atrium::Account.new()
end

Instance Method Details

#transactionsObject



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"
   = ::Atrium.client.make_request(:get, endpoint)

  transactions = ["transactions"].map do |transaction|
    ::Atrium::Transaction.new(transaction)
  end
end