Class: Worldline::Connect::SDK::V1::Domain::InstallmentOptions
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Connect::SDK::V1::Domain::InstallmentOptions
- Defined in:
- lib/worldline/connect/sdk/v1/domain/installment_options.rb
Instance Attribute Summary collapse
-
#display_hints ⇒ Worldline::Connect::SDK::V1::Domain::InstallmentDisplayHints
The current value of display_hints.
-
#id ⇒ String
The current value of id.
-
#installment_plans ⇒ Array<Worldline::Connect::SDK::V1::Domain::Installments>
The current value of installment_plans.
Instance Method Summary collapse
Methods inherited from Domain::DataObject
Instance Attribute Details
#display_hints ⇒ Worldline::Connect::SDK::V1::Domain::InstallmentDisplayHints
Returns the current value of display_hints.
17 18 19 |
# File 'lib/worldline/connect/sdk/v1/domain/installment_options.rb', line 17 def display_hints @display_hints end |
#id ⇒ String
Returns the current value of id.
17 18 19 |
# File 'lib/worldline/connect/sdk/v1/domain/installment_options.rb', line 17 def id @id end |
#installment_plans ⇒ Array<Worldline::Connect::SDK::V1::Domain::Installments>
Returns the current value of installment_plans.
17 18 19 |
# File 'lib/worldline/connect/sdk/v1/domain/installment_options.rb', line 17 def installment_plans @installment_plans end |
Instance Method Details
#from_hash(hash) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/worldline/connect/sdk/v1/domain/installment_options.rb', line 34 def from_hash(hash) super 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::InstallmentDisplayHints.new_from_hash(hash['displayHints']) end if hash.has_key? 'id' @id = hash['id'] end if hash.has_key? 'installmentPlans' raise TypeError, "value '%s' is not an Array" % [hash['installmentPlans']] unless hash['installmentPlans'].is_a? Array @installment_plans = [] hash['installmentPlans'].each do |e| @installment_plans << Worldline::Connect::SDK::V1::Domain::Installments.new_from_hash(e) end end end |
#to_h ⇒ Hash
26 27 28 29 30 31 32 |
# File 'lib/worldline/connect/sdk/v1/domain/installment_options.rb', line 26 def to_h hash = super hash['displayHints'] = @display_hints.to_h unless @display_hints.nil? hash['id'] = @id unless @id.nil? hash['installmentPlans'] = @installment_plans.collect{|val| val.to_h} unless @installment_plans.nil? hash end |