class Ingenico::Direct::SDK::Domain::PaymentProductField
@attr [Ingenico::Direct::SDK::Domain::PaymentProductFieldDataRestrictions] data_restrictions
@attr [Ingenico::Direct::SDK::Domain::PaymentProductFieldDisplayHints] display_hints
@attr [String] id @attr [String] type
Attributes
data_restrictions[RW]
display_hints[RW]
id[RW]
type[RW]
Public Instance Methods
from_hash(hash)
click to toggle source
Calls superclass method
Ingenico::Direct::SDK::DataObject#from_hash
# 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_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.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