class Monzo::Account

Public: Accounts represent a store of funds, and have a list of transactions.

Attributes

created[R]
description[R]
id[R]

Public Class Methods

all() click to toggle source

Public: Find all Monzo Accounts

Returns An Array of Monzo::Account

# File lib/monzo/account.rb, line 20
def self.all
  client = Monzo.client
  response = client.get("/accounts")
  parsed_response = JSON.parse(response.body, :symbolize_names => true)

  parsed_response[:accounts].map do |item|
    Monzo::Account.new(item)
  end
end
new(params) click to toggle source

Public: Initialize an Account.

params - A Hash of account parameters.

# File lib/monzo/account.rb, line 11
def initialize(params)
  @id = params[:id]
  @description = params[:description]
  @created = params[:created]
end