Class: Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDisplayHints

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

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#always_showObject

true/false



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

def always_show
  @always_show
end

#display_orderObject

Integer



20
21
22
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb', line 20

def display_order
  @display_order
end

#form_elementObject



23
24
25
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb', line 23

def form_element
  @form_element
end

#labelObject

String



26
27
28
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb', line 26

def label
  @label
end

#maskObject

String



29
30
31
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb', line 29

def mask
  @mask
end

#obfuscateObject

true/false



32
33
34
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb', line 32

def obfuscate
  @obfuscate
end

#placeholder_labelObject

String



35
36
37
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb', line 35

def placeholder_label
  @placeholder_label
end

#preferred_input_typeObject

String



38
39
40
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb', line 38

def preferred_input_type
  @preferred_input_type
end

#tooltipObject



41
42
43
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb', line 41

def tooltip
  @tooltip
end

Instance Method Details

#from_hash(hash) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb', line 57

def from_hash(hash)
  super
  if hash.has_key?('alwaysShow')
    @always_show = hash['alwaysShow']
  end
  if hash.has_key?('displayOrder')
    @display_order = hash['displayOrder']
  end
  if hash.has_key?('formElement')
    if !(hash['formElement'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['formElement']]
    end
    @form_element = Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldFormElement.new_from_hash(hash['formElement'])
  end
  if hash.has_key?('label')
    @label = hash['label']
  end
  if hash.has_key?('mask')
    @mask = hash['mask']
  end
  if hash.has_key?('obfuscate')
    @obfuscate = hash['obfuscate']
  end
  if hash.has_key?('placeholderLabel')
    @placeholder_label = hash['placeholderLabel']
  end
  if hash.has_key?('preferredInputType')
    @preferred_input_type = hash['preferredInputType']
  end
  if hash.has_key?('tooltip')
    if !(hash['tooltip'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['tooltip']]
    end
    @tooltip = Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldTooltip.new_from_hash(hash['tooltip'])
  end
end

#to_hObject



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb', line 43

def to_h
  hash = super
  add_to_hash(hash, 'alwaysShow', @always_show)
  add_to_hash(hash, 'displayOrder', @display_order)
  add_to_hash(hash, 'formElement', @form_element)
  add_to_hash(hash, 'label', @label)
  add_to_hash(hash, 'mask', @mask)
  add_to_hash(hash, 'obfuscate', @obfuscate)
  add_to_hash(hash, 'placeholderLabel', @placeholder_label)
  add_to_hash(hash, 'preferredInputType', @preferred_input_type)
  add_to_hash(hash, 'tooltip', @tooltip)
  hash
end