Class: Ingenico::Connect::SDK::Domain::Product::PaymentProductField

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/product/payment_product_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#data_restrictionsIngenico::Connect::SDK::Domain::Product::PaymentProductFieldDataRestrictions

Returns the current value of data_restrictions.

Returns:



18
19
20
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 18

def data_restrictions
  @data_restrictions
end

#display_hintsIngenico::Connect::SDK::Domain::Product::PaymentProductFieldDisplayHints

Returns the current value of display_hints.

Returns:



18
19
20
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 18

def display_hints
  @display_hints
end

#idString

Returns the current value of id.

Returns:

  • (String)

    the current value of id



18
19
20
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 18

def id
  @id
end

#typeString

Returns the current value of type.

Returns:

  • (String)

    the current value of type



18
19
20
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 18

def type
  @type
end

#used_for_lookuptrue/false

Returns the current value of used_for_lookup.

Returns:

  • (true/false)

    the current value of used_for_lookup



18
19
20
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 18

def used_for_lookup
  @used_for_lookup
end

Instance Method Details

#from_hash(hash) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 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_hHash

Returns:

  • (Hash)


31
32
33
34
35
36
37
38
39
# 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