class Ingenico::Direct::SDK::Domain::GiftCardPurchase
@attr [Ingenico::Direct::SDK::Domain::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
Calls superclass method
Ingenico::Direct::SDK::DataObject#from_hash
# File lib/ingenico/direct/sdk/domain/gift_card_purchase.rb, line 25 def from_hash(hash) super if hash.key? 'amountOfMoney' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash @amount_of_money = Ingenico::Direct::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney']) end @number_of_gift_cards = hash['numberOfGiftCards'] if hash.key? 'numberOfGiftCards' end
to_h()
click to toggle source
@return (Hash)
Calls superclass method
Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/gift_card_purchase.rb, line 18 def to_h hash = super hash['amountOfMoney'] = @amount_of_money.to_h if @amount_of_money hash['numberOfGiftCards'] = @number_of_gift_cards unless @number_of_gift_cards.nil? hash end