Class: OnlinePayments::SDK::Domain::PaymentProductField

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/payment_product_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#data_restrictionsOnlinePayments::SDK::Domain::PaymentProductFieldDataRestrictions

Returns the current value of data_restrictions.

Returns:



15
16
17
# File 'lib/onlinepayments/sdk/domain/payment_product_field.rb', line 15

def data_restrictions
  @data_restrictions
end

#display_hintsOnlinePayments::SDK::Domain::PaymentProductFieldDisplayHints

Returns the current value of display_hints.

Returns:



15
16
17
# File 'lib/onlinepayments/sdk/domain/payment_product_field.rb', line 15

def display_hints
  @display_hints
end

#idString

Returns the current value of id.

Returns:

  • (String)

    the current value of id



15
16
17
# File 'lib/onlinepayments/sdk/domain/payment_product_field.rb', line 15

def id
  @id
end

#typeString

Returns the current value of type.

Returns:

  • (String)

    the current value of type



15
16
17
# File 'lib/onlinepayments/sdk/domain/payment_product_field.rb', line 15

def type
  @type
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

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 = OnlinePayments::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 = OnlinePayments::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)


22
23
24
25
26
27
28
29
# File 'lib/onlinepayments/sdk/domain/payment_product_field.rb', line 22

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