class Ingenico::Connect::SDK::Domain::Product::AccountOnFile
@attr [Array<Ingenico::Connect::SDK::Domain::Product::AccountOnFileAttribute>] attributes @attr [Ingenico::Connect::SDK::Domain::Product::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::Connect::SDK::DataObject#from_hash
# File lib/ingenico/connect/sdk/domain/product/account_on_file.rb, line 37 def from_hash(hash) super if hash.has_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::Connect::SDK::Domain::Product::AccountOnFileAttribute.new_from_hash(e) end end if hash.has_key? 'displayHints' raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash @display_hints = Ingenico::Connect::SDK::Domain::Product::AccountOnFileDisplayHints.new_from_hash(hash['displayHints']) end if hash.has_key? 'id' @id = hash['id'] end if hash.has_key? 'paymentProductId' @payment_product_id = hash['paymentProductId'] 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/product/account_on_file.rb, line 28 def to_h hash = super hash['attributes'] = @attributes.collect{|val| val.to_h} unless @attributes.nil? hash['displayHints'] = @display_hints.to_h unless @display_hints.nil? hash['id'] = @id unless @id.nil? hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil? hash end