class Ingenico::Connect::SDK::Domain::Product::ValueMappingElement

@attr [Array<Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDisplayElement>] display_elements @attr [String] display_name @attr [String] value

Attributes

display_elements[RW]
display_name[RW]

@deprecated Use displayElements instead with ID 'displayName'

value[RW]

Public Instance Methods

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