Class: SixSaferpay::MastercardIssuerInstallments
- Inherits:
-
Object
- Object
- SixSaferpay::MastercardIssuerInstallments
- Defined in:
- lib/six_saferpay/models/mastercard_issuer_installments.rb
Instance Attribute Summary collapse
-
#chosen_plan ⇒ Object
Returns the value of attribute chosen_plan.
-
#custom_plan ⇒ Object
Returns the value of attribute custom_plan.
-
#installment_plans ⇒ Object
Returns the value of attribute installment_plans.
-
#receipt_free_text ⇒ Object
Returns the value of attribute receipt_free_text.
Instance Method Summary collapse
-
#initialize(installment_plans: nil, custom_plan: nil, chosen_plan: nil, receipt_free_text: nil) ⇒ MastercardIssuerInstallments
constructor
A new instance of MastercardIssuerInstallments.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(installment_plans: nil, custom_plan: nil, chosen_plan: nil, receipt_free_text: nil) ⇒ MastercardIssuerInstallments
Returns a new instance of MastercardIssuerInstallments.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/six_saferpay/models/mastercard_issuer_installments.rb', line 11 def initialize( installment_plans: nil, custom_plan: nil, chosen_plan: nil, receipt_free_text: nil ) if installment_plans @installment_plans = SixSaferpay::InstallmentPlans .new(**installment_plans.to_h) end if custom_plan @custom_plan = SixSaferpay::CustomPlan .new(**custom_plan.to_h) end if chosen_plan @chosen_plan = SixSaferpay::ChosenPlan .new(**chosen_plan.to_h) end @receipt_free_text = receipt_free_text end |
Instance Attribute Details
#chosen_plan ⇒ Object
Returns the value of attribute chosen_plan.
4 5 6 |
# File 'lib/six_saferpay/models/mastercard_issuer_installments.rb', line 4 def chosen_plan @chosen_plan end |
#custom_plan ⇒ Object
Returns the value of attribute custom_plan.
4 5 6 |
# File 'lib/six_saferpay/models/mastercard_issuer_installments.rb', line 4 def custom_plan @custom_plan end |
#installment_plans ⇒ Object
Returns the value of attribute installment_plans.
4 5 6 |
# File 'lib/six_saferpay/models/mastercard_issuer_installments.rb', line 4 def installment_plans @installment_plans end |
#receipt_free_text ⇒ Object
Returns the value of attribute receipt_free_text.
4 5 6 |
# File 'lib/six_saferpay/models/mastercard_issuer_installments.rb', line 4 def receipt_free_text @receipt_free_text end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/six_saferpay/models/mastercard_issuer_installments.rb', line 32 def to_hash hash = Hash.new if @installment_plans hash.merge!(installment_plans: @installment_plans.to_h) end if @custom_plan hash.merge!(custom_plan: @custom_plan.to_h) end if @chosen_plan hash.merge!(chosen_plan: @chosen_plan.to_h) end hash.merge!(receipt_free_text: @receipt_free_text) hash end |