class EwayRapid::InternalModels::BalancePerCardType

Attributes

balance[RW]
card_type[RW]
credit[RW]
debit[RW]
number_of_transactions[RW]

Public Class Methods

from_array(array) click to toggle source
# File lib/eway_rapid/models/internal_models.rb, line 509
def self.from_array(array)
  balances = []
  Array(array).each {|balance_hash|
    obj = from_hash(balance_hash)
    balances.push(obj)
  }
  balances
end
from_hash(hash) click to toggle source
# File lib/eway_rapid/models/internal_models.rb, line 499
def self.from_hash(hash)
  balance = BalancePerCardType.new
  balance.card_type = hash[Constants::CARD_TYPE]
  balance.number_of_transactions = hash[Constants::NUMBER_OF_TRANSACTIONS]
  balance.credit = hash[Constants::CREDIT]
  balance.debit = hash[Constants::DEBIT]
  balance.balance = hash[Constants::BALANCE]
  balance
end
from_json(json) click to toggle source
# File lib/eway_rapid/models/internal_models.rb, line 494
def self.from_json(json)
  hash = JSON.parse(json)
  from_hash(hash)
end