class Ingenico::Connect::SDK::Domain::Payment::GiftCardPurchase

@attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] amount_of_money @attr [Integer] number_of_gift_cards

Attributes

amount_of_money[RW]
number_of_gift_cards[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/connect/sdk/domain/payment/gift_card_purchase.rb, line 28
def from_hash(hash)
  super
  if hash.has_key? 'amountOfMoney'
    raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash
    @amount_of_money = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
  end
  if hash.has_key? 'numberOfGiftCards'
    @number_of_gift_cards = hash['numberOfGiftCards']
  end
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Connect::SDK::DataObject#to_h
# File lib/ingenico/connect/sdk/domain/payment/gift_card_purchase.rb, line 21
def to_h
  hash = super
  hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil?
  hash['numberOfGiftCards'] = @number_of_gift_cards unless @number_of_gift_cards.nil?
  hash
end