class Ingenico::Direct::SDK::Domain::PaymentProductFieldFormElement

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

Attributes

type[RW]
value_mapping[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/domain/payment_product_field_form_element.rb, line 25
def from_hash(hash)
  super
  @type = hash['type'] if hash.key? 'type'
  if hash.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::Direct::SDK::Domain::ValueMappingElement.new_from_hash(e)
    end
  end
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/payment_product_field_form_element.rb, line 18
def to_h
  hash = super
  hash['type'] = @type unless @type.nil?
  hash['valueMapping'] = @value_mapping.collect(&:to_h) if @value_mapping
  hash
end