class Ingenico::Direct::SDK::Domain::PaymentProductFieldDisplayHints

@attr [true/false] always_show @attr [Integer] display_order @attr [Ingenico::Direct::SDK::Domain::PaymentProductFieldFormElement] form_element @attr [String] label @attr [String] link @attr [String] mask @attr [true/false] obfuscate @attr [String] placeholder_label @attr [String] preferred_input_type @attr [Ingenico::Direct::SDK::Domain::PaymentProductFieldTooltip] tooltip

Attributes

always_show[RW]
display_order[RW]
form_element[RW]
label[RW]
mask[RW]
obfuscate[RW]
placeholder_label[RW]
preferred_input_type[RW]
tooltip[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/domain/payment_product_field_display_hints.rb, line 50
def from_hash(hash)
  super
  @always_show = hash['alwaysShow'] if hash.key? 'alwaysShow'
  @display_order = hash['displayOrder'] if hash.key? 'displayOrder'
  if hash.key? 'formElement'
    raise TypeError, "value '%s' is not a Hash" % [hash['formElement']] unless hash['formElement'].is_a? Hash
    @form_element = Ingenico::Direct::SDK::Domain::PaymentProductFieldFormElement.new_from_hash(hash['formElement'])
  end
  @label = hash['label'] if hash.key? 'label'
  @link = hash['link'] if hash.key? 'link'
  @mask = hash['mask'] if hash.key? 'mask'
  @obfuscate = hash['obfuscate'] if hash.key? 'obfuscate'
  @placeholder_label = hash['placeholderLabel'] if hash.key? 'placeholderLabel'
  @preferred_input_type = hash['preferredInputType'] if hash.key? 'preferredInputType'
  if hash.key? 'tooltip'
    raise TypeError, "value '%s' is not a Hash" % [hash['tooltip']] unless hash['tooltip'].is_a? Hash
    @tooltip = Ingenico::Direct::SDK::Domain::PaymentProductFieldTooltip.new_from_hash(hash['tooltip'])
  end
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/payment_product_field_display_hints.rb, line 35
def to_h
  hash = super
  hash['alwaysShow'] = @always_show unless @always_show.nil?
  hash['displayOrder'] = @display_order unless @display_order.nil?
  hash['formElement'] = @form_element.to_h if @form_element
  hash['label'] = @label unless @label.nil?
  hash['link'] = @link unless @link.nil?
  hash['mask'] = @mask unless @mask.nil?
  hash['obfuscate'] = @obfuscate unless @obfuscate.nil?
  hash['placeholderLabel'] = @placeholder_label unless @placeholder_label.nil?
  hash['preferredInputType'] = @preferred_input_type unless @preferred_input_type.nil?
  hash['tooltip'] = @tooltip.to_h if @tooltip
  hash
end