class Ingenico::Direct::SDK::Domain::AccountOnFileDisplayHints

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

Attributes

label_template[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/domain/account_on_file_display_hints.rb, line 25
def from_hash(hash)
  super
  if hash.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::Direct::SDK::Domain::LabelTemplateElement.new_from_hash(e)
    end
  end
  @logo = hash['logo'] if hash.key? 'logo'
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_display_hints.rb, line 18
def to_h
  hash = super
  hash['labelTemplate'] = @label_template.collect(&:to_h) if @label_template
  hash['logo'] = @logo unless @logo.nil?
  hash
end