class Ingenico::Connect::SDK::Domain::Product::AccountOnFileDisplayHints

@attr [Array<Ingenico::Connect::SDK::Domain::Product::LabelTemplateElement>] label_template @attr [String] logo

Attributes

label_template[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/connect/sdk/domain/product/account_on_file_display_hints.rb, line 28
def from_hash(hash)
  super
  if hash.has_key? 'labelTemplate'
    raise TypeError, "value '%s' is not an Array" % [hash['labelTemplate']] unless hash['labelTemplate'].is_a? Array
    @label_template = []
    hash['labelTemplate'].each do |e|
      @label_template << Ingenico::Connect::SDK::Domain::Product::LabelTemplateElement.new_from_hash(e)
    end
  end
  if hash.has_key? 'logo'
    @logo = hash['logo']
  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_display_hints.rb, line 21
def to_h
  hash = super
  hash['labelTemplate'] = @label_template.collect{|val| val.to_h} unless @label_template.nil?
  hash['logo'] = @logo unless @logo.nil?
  hash
end