class Ingenico::Direct::SDK::Domain::PaymentProductGroup
@attr [Ingenico::Direct::SDK::Domain::AccountOnFile] account_on_file
@attr [Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints] display_hints
@attr [Array<Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints>] display_hints_list
@attr [String] id
Attributes
account_on_file[RW]
display_hints[RW]
display_hints_list[RW]
id[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/payment_product_group.rb, line 32 def from_hash(hash) super if hash.key? 'accountOnFile' raise TypeError, "value '%s' is not a Hash" % [hash['accountOnFile']] unless hash['accountOnFile'].is_a? Hash @account_on_file = Ingenico::Direct::SDK::Domain::AccountOnFile.new_from_hash(hash['accountOnFile']) end if hash.key? 'displayHints' raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash @display_hints = Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints.new_from_hash(hash['displayHints']) end if hash.key? 'displayHintsList' raise TypeError, "value '%s' is not an Array" % [hash['displayHintsList']] unless hash['displayHintsList'].is_a? Array @display_hints_list = [] hash['displayHintsList'].each do |e| @display_hints_list << Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints.new_from_hash(e) end end @id = hash['id'] if hash.key? 'id' end
to_h()
click to toggle source
@return (Hash)
Calls superclass method
Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/payment_product_group.rb, line 23 def to_h hash = super hash['accountOnFile'] = @account_on_file.to_h if @account_on_file hash['displayHints'] = @display_hints.to_h if @display_hints hash['displayHintsList'] = @display_hints_list.collect(&:to_h) if @display_hints_list hash['id'] = @id unless @id.nil? hash end