Class: Ingenico::Connect::SDK::Domain::Product::ValueMappingElement
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Product::ValueMappingElement
- Defined in:
- lib/ingenico/connect/sdk/domain/product/value_mapping_element.rb
Instance Attribute Summary collapse
-
#display_elements ⇒ Array<Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDisplayElement>
The current value of display_elements.
-
#display_name ⇒ Object
deprecated
Deprecated.
Use displayElements instead with ID ‘displayName’
-
#value ⇒ String
The current value of value.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#display_elements ⇒ Array<Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDisplayElement>
Returns the current value of display_elements.
16 17 18 |
# File 'lib/ingenico/connect/sdk/domain/product/value_mapping_element.rb', line 16 def display_elements @display_elements end |
#display_name ⇒ Object
Deprecated.
Use displayElements instead with ID ‘displayName’
16 17 18 |
# File 'lib/ingenico/connect/sdk/domain/product/value_mapping_element.rb', line 16 def display_name @display_name end |
#value ⇒ String
Returns the current value of value.
16 17 18 |
# File 'lib/ingenico/connect/sdk/domain/product/value_mapping_element.rb', line 16 def value @value end |
Instance Method Details
#from_hash(hash) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/ingenico/connect/sdk/domain/product/value_mapping_element.rb', line 35 def from_hash(hash) super if hash.has_key? 'displayElements' raise TypeError, "value '%s' is not an Array" % [hash['displayElements']] unless hash['displayElements'].is_a? Array @display_elements = [] hash['displayElements'].each do |e| @display_elements << Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDisplayElement.new_from_hash(e) end end if hash.has_key? 'displayName' @display_name = hash['displayName'] end if hash.has_key? 'value' @value = hash['value'] end end |
#to_h ⇒ Hash
27 28 29 30 31 32 33 |
# File 'lib/ingenico/connect/sdk/domain/product/value_mapping_element.rb', line 27 def to_h hash = super hash['displayElements'] = @display_elements.collect{|val| val.to_h} unless @display_elements.nil? hash['displayName'] = @display_name unless @display_name.nil? hash['value'] = @value unless @value.nil? hash end |