Class: OnlinePayments::SDK::Domain::AccountOnFile
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::AccountOnFile
- Defined in:
- lib/onlinepayments/sdk/domain/account_on_file.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Array<OnlinePayments::SDK::Domain::AccountOnFileAttribute>
The current value of attributes.
-
#display_hints ⇒ OnlinePayments::SDK::Domain::AccountOnFileDisplayHints
The current value of display_hints.
-
#id ⇒ Integer
The current value of id.
-
#payment_product_id ⇒ Integer
The current value of payment_product_id.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#attributes ⇒ Array<OnlinePayments::SDK::Domain::AccountOnFileAttribute>
Returns the current value of attributes.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/account_on_file.rb', line 15 def attributes @attributes end |
#display_hints ⇒ OnlinePayments::SDK::Domain::AccountOnFileDisplayHints
Returns the current value of display_hints.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/account_on_file.rb', line 15 def display_hints @display_hints end |
#id ⇒ Integer
Returns the current value of id.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/account_on_file.rb', line 15 def id @id end |
#payment_product_id ⇒ Integer
Returns the current value of payment_product_id.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/account_on_file.rb', line 15 def payment_product_id @payment_product_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 |
# File 'lib/onlinepayments/sdk/domain/account_on_file.rb', line 31 def from_hash(hash) super if hash.key? 'attributes' raise TypeError, "value '%s' is not an Array" % [hash['attributes']] unless hash['attributes'].is_a? Array @attributes = [] hash['attributes'].each do |e| @attributes << OnlinePayments::SDK::Domain::AccountOnFileAttribute.new_from_hash(e) end 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::AccountOnFileDisplayHints.new_from_hash(hash['displayHints']) end @id = hash['id'] if hash.key? 'id' @payment_product_id = hash['paymentProductId'] if hash.key? 'paymentProductId' end |
#to_h ⇒ Hash
22 23 24 25 26 27 28 29 |
# File 'lib/onlinepayments/sdk/domain/account_on_file.rb', line 22 def to_h hash = super hash['attributes'] = @attributes.collect(&:to_h) if @attributes hash['displayHints'] = @display_hints.to_h if @display_hints hash['id'] = @id unless @id.nil? hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil? hash end |