class Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldFormElement

@attr [String] type @attr [Array<Ingenico::Connect::SDK::Domain::Product::ValueMappingElement>] value_mapping

Attributes

type[RW]
value_mapping[RW]

Public Instance Methods

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