Class: Ingenico::Direct::SDK::Domain::AccountOnFileDisplayHints

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/account_on_file_display_hints.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#label_templateArray<Ingenico::Direct::SDK::Domain::LabelTemplateElement>

Returns the current value of label_template.

Returns:



13
14
15
# File 'lib/ingenico/direct/sdk/domain/account_on_file_display_hints.rb', line 13

def label_template
  @label_template
end

#logoString

Returns the current value of logo.

Returns:

  • (String)

    the current value of logo



13
14
15
# File 'lib/ingenico/direct/sdk/domain/account_on_file_display_hints.rb', line 13

def 
  @logo
end

Instance Method Details

#from_hash(hash) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# 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_hHash

Returns:

  • (Hash)


18
19
20
21
22
23
# 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