Class: Starling::Resources::AccountBalanceResource

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/starling/resources/account_balance_resource.rb

Overview

A resource representing a response from the Account Balance API

Instance Method Summary collapse

Methods inherited from BaseResource

#initialize

Constructor Details

This class inherits a constructor from Starling::Resources::BaseResource

Instance Method Details

#accepted_overdraftFloat

Returns the account’s accepted overdraft.

Returns:

  • (Float)

    the account’s accepted overdraft



6
7
8
# File 'lib/starling/resources/account_balance_resource.rb', line 6

def accepted_overdraft
  present_float(parsed_data['acceptedOverdraft'])
end

#amountFloat

Returns the account’s balance.

Returns:

  • (Float)

    the account’s balance



11
12
13
# File 'lib/starling/resources/account_balance_resource.rb', line 11

def amount
  present_float(parsed_data['amount'])
end

#available_to_spendFloat

Returns the account’s amount available to spend.

Returns:

  • (Float)

    the account’s amount available to spend



16
17
18
# File 'lib/starling/resources/account_balance_resource.rb', line 16

def available_to_spend
  present_float(parsed_data['availableToSpend'])
end

#cleared_balanceFloat

Returns the account’s cleared balance.

Returns:

  • (Float)

    the account’s cleared balance



21
22
23
# File 'lib/starling/resources/account_balance_resource.rb', line 21

def cleared_balance
  present_float(parsed_data['clearedBalance'])
end

#currencyString

Returns the account’s currency (e.g. “GBP”).

Returns:

  • (String)

    the account’s currency (e.g. “GBP”)



26
27
28
# File 'lib/starling/resources/account_balance_resource.rb', line 26

def currency
  parsed_data['currency']
end

#effective_balanceFloat

Returns the account’s effective balance.

Returns:

  • (Float)

    the account’s effective balance



31
32
33
# File 'lib/starling/resources/account_balance_resource.rb', line 31

def effective_balance
  present_float(parsed_data['effectiveBalance'])
end

#pending_transactionsFloat

Returns the total of the account’s pending transactions.

Returns:

  • (Float)

    the total of the account’s pending transactions



36
37
38
# File 'lib/starling/resources/account_balance_resource.rb', line 36

def pending_transactions
  present_float(parsed_data['pendingTransactions'])
end