Class: OnlinePayments::SDK::Domain::PaymentProductGroup
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::PaymentProductGroup
- Defined in:
- lib/onlinepayments/sdk/domain/payment_product_group.rb
Instance Attribute Summary collapse
-
#account_on_file ⇒ OnlinePayments::SDK::Domain::AccountOnFile
The current value of account_on_file.
-
#display_hints ⇒ OnlinePayments::SDK::Domain::PaymentProductDisplayHints
The current value of display_hints.
-
#display_hints_list ⇒ Array<OnlinePayments::SDK::Domain::PaymentProductDisplayHints>
The current value of display_hints_list.
-
#id ⇒ String
The current value of id.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#account_on_file ⇒ OnlinePayments::SDK::Domain::AccountOnFile
Returns the current value of account_on_file.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_product_group.rb', line 15 def account_on_file @account_on_file end |
#display_hints ⇒ OnlinePayments::SDK::Domain::PaymentProductDisplayHints
Returns the current value of display_hints.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_product_group.rb', line 15 def display_hints @display_hints end |
#display_hints_list ⇒ Array<OnlinePayments::SDK::Domain::PaymentProductDisplayHints>
Returns the current value of display_hints_list.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_product_group.rb', line 15 def display_hints_list @display_hints_list end |
#id ⇒ String
Returns the current value of id.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_product_group.rb', line 15 def id @id end |
Instance Method Details
#from_hash(hash) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/onlinepayments/sdk/domain/payment_product_group.rb', line 31 def from_hash(hash) super if hash.key? 'accountOnFile' raise TypeError, "value '%s' is not a Hash" % [hash['accountOnFile']] unless hash['accountOnFile'].is_a? Hash @account_on_file = OnlinePayments::SDK::Domain::AccountOnFile.new_from_hash(hash['accountOnFile']) 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::PaymentProductDisplayHints.new_from_hash(hash['displayHints']) end if hash.key? 'displayHintsList' raise TypeError, "value '%s' is not an Array" % [hash['displayHintsList']] unless hash['displayHintsList'].is_a? Array @display_hints_list = [] hash['displayHintsList'].each do |e| @display_hints_list << OnlinePayments::SDK::Domain::PaymentProductDisplayHints.new_from_hash(e) end end @id = hash['id'] if hash.key? 'id' end |
#to_h ⇒ Hash
22 23 24 25 26 27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product_group.rb', line 22 def to_h hash = super hash['accountOnFile'] = @account_on_file.to_h if @account_on_file hash['displayHints'] = @display_hints.to_h if @display_hints hash['displayHintsList'] = @display_hints_list.collect(&:to_h) if @display_hints_list hash['id'] = @id unless @id.nil? hash end |