Class: Ingenico::Direct::SDK::Domain::PaymentProductField

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/payment_product_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#data_restrictionsIngenico::Direct::SDK::Domain::PaymentProductFieldDataRestrictions

Returns the current value of data_restrictions.

Returns:



16
17
18
# File 'lib/ingenico/direct/sdk/domain/payment_product_field.rb', line 16

def data_restrictions
  @data_restrictions
end

#display_hintsIngenico::Direct::SDK::Domain::PaymentProductFieldDisplayHints

Returns the current value of display_hints.

Returns:



16
17
18
# File 'lib/ingenico/direct/sdk/domain/payment_product_field.rb', line 16

def display_hints
  @display_hints
end

#idString

Returns the current value of id.

Returns:

  • (String)

    the current value of id



16
17
18
# File 'lib/ingenico/direct/sdk/domain/payment_product_field.rb', line 16

def id
  @id
end

#typeString

Returns the current value of type.

Returns:

  • (String)

    the current value of type



16
17
18
# File 'lib/ingenico/direct/sdk/domain/payment_product_field.rb', line 16

def type
  @type
end

Instance Method Details

#from_hash(hash) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ingenico/direct/sdk/domain/payment_product_field.rb', line 32

def from_hash(hash)
  super
  if hash.key? 'dataRestrictions'
    raise TypeError, "value '%s' is not a Hash" % [hash['dataRestrictions']] unless hash['dataRestrictions'].is_a? Hash
    @data_restrictions = Ingenico::Direct::SDK::Domain::PaymentProductFieldDataRestrictions.new_from_hash(hash['dataRestrictions'])
  end
  if hash.key? 'displayHints'
    raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash
    @display_hints = Ingenico::Direct::SDK::Domain::PaymentProductFieldDisplayHints.new_from_hash(hash['displayHints'])
  end
  @id = hash['id'] if hash.key? 'id'
  @type = hash['type'] if hash.key? 'type'
end

#to_hHash

Returns:

  • (Hash)


23
24
25
26
27
28
29
30
# File 'lib/ingenico/direct/sdk/domain/payment_product_field.rb', line 23

def to_h
  hash = super
  hash['dataRestrictions'] = @data_restrictions.to_h if @data_restrictions
  hash['displayHints'] = @display_hints.to_h if @display_hints
  hash['id'] = @id unless @id.nil?
  hash['type'] = @type unless @type.nil?
  hash
end