class FinancialAccount

Attributes

account_name[RW]
account_number[RW]
closing_balance[RW]
credits_count[RW]
credits_sum[RW]
currency_iso[RW]
debits_count[RW]
debits_sum[RW]
from_date[RW]
holder[RW]
last_updated_utc[RW]
sort_code[RW]
transactions[RW]
type[RW]

Public Class Methods

from_hash(hash) click to toggle source
# File lib/miiCardConsumers.rb, line 417
def self.from_hash(hash)
        transactions = hash["Transactions"]
        transactions_parsed = nil
        unless (transactions.nil? || transactions.empty?)
                transactions_parsed = transactions.map{|item| FinancialTransaction::from_hash(item)}
        end

        return FinancialAccount.new(
                hash['AccountName'],
                hash['Holder'],
                hash['SortCode'],
                hash['AccountNumber'],
                hash['Type'],
                (Util::parse_dot_net_json_datetime(hash['FromDate']) rescue nil),
                (Util::parse_dot_net_json_datetime(hash['LastUpdatedUtc']) rescue nil),
                hash['ClosingBalance'],
                hash['DebitsSum'],
                hash['DebitsCount'],
                hash['CreditsSum'],
                hash['CreditsCount'],
                hash['CurrencyIso'],
                transactions_parsed
        )
end
new(account_name, holder, sort_code, account_number, type, from_date, last_updated_utc, closing_balance, debits_sum, debits_count, credits_sum, credits_count, currency_iso, transactions) click to toggle source
# File lib/miiCardConsumers.rb, line 400
def initialize(account_name, holder, sort_code, account_number, type, from_date, last_updated_utc, closing_balance, debits_sum, debits_count, credits_sum, credits_count, currency_iso, transactions)
        @account_name = account_name
        @holder = holder
        @sort_code = sort_code
        @account_number = account_number
        @type = type
        @from_date = from_date
        @last_updated_utc = last_updated_utc
        @closing_balance = closing_balance
        @debits_sum = debits_sum
        @debits_count = debits_count
        @credits_sum = credits_sum
        @credits_count = credits_count
        @currency_iso = currency_iso
        @transactions = transactions
end