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