class Monzo::Balance

Public: Retrieve information about an account’s balance.

Attributes

balance[R]
currency[R]
local_currency[R]
local_exchange_rate[R]
local_spend[R]
spend_today[R]

Public Class Methods

find(account_id) click to toggle source

Public: Find the balance of the given account id.

account_id - The Monzo account id to find the balance for.

Returns an instance of Monzo::Balance

# File lib/monzo/balance.rb, line 26
def self.find(account_id)
  client = Monzo.client
  response = client.get("/balance", {:account_id => account_id})
  parsed_response = JSON.parse(response.body, :symbolize_names => true)

  Monzo::Balance.new(parsed_response)
end
new(params) click to toggle source

Public: Initialize a Balance.

params - A Hash of balance parameters.

# File lib/monzo/balance.rb, line 12
def initialize(params)
  @balance = params[:balance]
  @currency = params[:currency]
  @spend_today = params[:spend_today]
  @local_currency = params[:local_currency]
  @local_exchange_rate = params[:local_exchange_rate]
  @local_spend = params[:local_spend]
end