Class: Worldline::Connect::SDK::V1::Domain::AccountOnFile
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Connect::SDK::V1::Domain::AccountOnFile
- Defined in:
- lib/worldline/connect/sdk/v1/domain/account_on_file.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Array<Worldline::Connect::SDK::V1::Domain::AccountOnFileAttribute>
The current value of attributes.
-
#display_hints ⇒ Worldline::Connect::SDK::V1::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 Domain::DataObject
Instance Attribute Details
#attributes ⇒ Array<Worldline::Connect::SDK::V1::Domain::AccountOnFileAttribute>
Returns the current value of attributes.
18 19 20 |
# File 'lib/worldline/connect/sdk/v1/domain/account_on_file.rb', line 18 def attributes @attributes end |
#display_hints ⇒ Worldline::Connect::SDK::V1::Domain::AccountOnFileDisplayHints
Returns the current value of display_hints.
18 19 20 |
# File 'lib/worldline/connect/sdk/v1/domain/account_on_file.rb', line 18 def display_hints @display_hints end |
#id ⇒ Integer
Returns the current value of id.
18 19 20 |
# File 'lib/worldline/connect/sdk/v1/domain/account_on_file.rb', line 18 def id @id end |
#payment_product_id ⇒ Integer
Returns the current value of payment_product_id.
18 19 20 |
# File 'lib/worldline/connect/sdk/v1/domain/account_on_file.rb', line 18 def payment_product_id @payment_product_id end |
Instance Method Details
#from_hash(hash) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/worldline/connect/sdk/v1/domain/account_on_file.rb', line 38 def from_hash(hash) super if hash.has_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 << Worldline::Connect::SDK::V1::Domain::AccountOnFileAttribute.new_from_hash(e) end end if hash.has_key? 'displayHints' raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash @display_hints = Worldline::Connect::SDK::V1::Domain::AccountOnFileDisplayHints.new_from_hash(hash['displayHints']) end if hash.has_key? 'id' @id = hash['id'] end if hash.has_key? 'paymentProductId' @payment_product_id = hash['paymentProductId'] end end |
#to_h ⇒ Hash
29 30 31 32 33 34 35 36 |
# File 'lib/worldline/connect/sdk/v1/domain/account_on_file.rb', line 29 def to_h hash = super hash['attributes'] = @attributes.collect{|val| val.to_h} unless @attributes.nil? hash['displayHints'] = @display_hints.to_h unless @display_hints.nil? hash['id'] = @id unless @id.nil? hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil? hash end |