Class: EwayRapid::InternalModels::BalancePerCardType
- Inherits:
-
Object
- Object
- EwayRapid::InternalModels::BalancePerCardType
- Defined in:
- lib/eway_rapid/models/internal_models.rb
Instance Attribute Summary collapse
-
#balance ⇒ Object
Returns the value of attribute balance.
-
#card_type ⇒ Object
Returns the value of attribute card_type.
-
#credit ⇒ Object
Returns the value of attribute credit.
-
#debit ⇒ Object
Returns the value of attribute debit.
-
#number_of_transactions ⇒ Object
Returns the value of attribute number_of_transactions.
Class Method Summary collapse
Instance Attribute Details
#balance ⇒ Object
Returns the value of attribute balance.
472 473 474 |
# File 'lib/eway_rapid/models/internal_models.rb', line 472 def balance @balance end |
#card_type ⇒ Object
Returns the value of attribute card_type.
468 469 470 |
# File 'lib/eway_rapid/models/internal_models.rb', line 468 def card_type @card_type end |
#credit ⇒ Object
Returns the value of attribute credit.
470 471 472 |
# File 'lib/eway_rapid/models/internal_models.rb', line 470 def credit @credit end |
#debit ⇒ Object
Returns the value of attribute debit.
471 472 473 |
# File 'lib/eway_rapid/models/internal_models.rb', line 471 def debit @debit end |
#number_of_transactions ⇒ Object
Returns the value of attribute number_of_transactions.
469 470 471 |
# File 'lib/eway_rapid/models/internal_models.rb', line 469 def number_of_transactions @number_of_transactions end |
Class Method Details
.from_array(array) ⇒ Object
489 490 491 492 493 494 495 496 |
# File 'lib/eway_rapid/models/internal_models.rb', line 489 def self.from_array(array) balances = [] Array(array).each {|balance_hash| obj = from_hash(balance_hash) balances.push(obj) } balances end |
.from_hash(hash) ⇒ Object
479 480 481 482 483 484 485 486 487 |
# File 'lib/eway_rapid/models/internal_models.rb', line 479 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) ⇒ Object
474 475 476 477 |
# File 'lib/eway_rapid/models/internal_models.rb', line 474 def self.from_json(json) hash = JSON.parse(json) from_hash(hash) end |