class Ingenico::Connect::SDK::Domain::Product::PaymentProductField

@attr [Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDataRestrictions] data_restrictions @attr [Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDisplayHints] display_hints @attr [String] id @attr [String] type @attr [true/false] used_for_lookup

Attributes

data_restrictions[RW]
display_hints[RW]
id[RW]
type[RW]
used_for_lookup[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/connect/sdk/domain/product/payment_product_field.rb, line 41
def from_hash(hash)
  super
  if hash.has_key? 'dataRestrictions'
    raise TypeError, "value '%s' is not a Hash" % [hash['dataRestrictions']] unless hash['dataRestrictions'].is_a? Hash
    @data_restrictions = Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDataRestrictions.new_from_hash(hash['dataRestrictions'])
  end
  if hash.has_key? 'displayHints'
    raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash
    @display_hints = Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDisplayHints.new_from_hash(hash['displayHints'])
  end
  if hash.has_key? 'id'
    @id = hash['id']
  end
  if hash.has_key? 'type'
    @type = hash['type']
  end
  if hash.has_key? 'usedForLookup'
    @used_for_lookup = hash['usedForLookup']
  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.rb, line 31
def to_h
  hash = super
  hash['dataRestrictions'] = @data_restrictions.to_h unless @data_restrictions.nil?
  hash['displayHints'] = @display_hints.to_h unless @display_hints.nil?
  hash['id'] = @id unless @id.nil?
  hash['type'] = @type unless @type.nil?
  hash['usedForLookup'] = @used_for_lookup unless @used_for_lookup.nil?
  hash
end