Class: Ingenico::Connect::SDK::Domain::Payment::Installments
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Payment::Installments
- Defined in:
- lib/ingenico/connect/sdk/domain/payment/installments.rb
Instance Attribute Summary collapse
-
#amount_of_money_per_installment ⇒ Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney
The current value of amount_of_money_per_installment.
-
#amount_of_money_total ⇒ Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney
The current value of amount_of_money_total.
-
#frequency_of_installments ⇒ String
The current value of frequency_of_installments.
-
#installment_plan_code ⇒ Integer
The current value of installment_plan_code.
-
#interest_rate ⇒ String
The current value of interest_rate.
-
#number_of_installments ⇒ Integer
The current value of number_of_installments.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#amount_of_money_per_installment ⇒ Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney
Returns the current value of amount_of_money_per_installment.
18 19 20 |
# File 'lib/ingenico/connect/sdk/domain/payment/installments.rb', line 18 def amount_of_money_per_installment @amount_of_money_per_installment end |
#amount_of_money_total ⇒ Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney
Returns the current value of amount_of_money_total.
18 19 20 |
# File 'lib/ingenico/connect/sdk/domain/payment/installments.rb', line 18 def amount_of_money_total @amount_of_money_total end |
#frequency_of_installments ⇒ String
Returns the current value of frequency_of_installments.
18 19 20 |
# File 'lib/ingenico/connect/sdk/domain/payment/installments.rb', line 18 def frequency_of_installments @frequency_of_installments end |
#installment_plan_code ⇒ Integer
Returns the current value of installment_plan_code.
18 19 20 |
# File 'lib/ingenico/connect/sdk/domain/payment/installments.rb', line 18 def installment_plan_code @installment_plan_code end |
#interest_rate ⇒ String
Returns the current value of interest_rate.
18 19 20 |
# File 'lib/ingenico/connect/sdk/domain/payment/installments.rb', line 18 def interest_rate @interest_rate end |
#number_of_installments ⇒ Integer
Returns the current value of number_of_installments.
18 19 20 |
# File 'lib/ingenico/connect/sdk/domain/payment/installments.rb', line 18 def number_of_installments @number_of_installments end |
Instance Method Details
#from_hash(hash) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/ingenico/connect/sdk/domain/payment/installments.rb', line 44 def from_hash(hash) super if hash.has_key? 'amountOfMoneyPerInstallment' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoneyPerInstallment']] unless hash['amountOfMoneyPerInstallment'].is_a? Hash @amount_of_money_per_installment = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoneyPerInstallment']) end if hash.has_key? 'amountOfMoneyTotal' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoneyTotal']] unless hash['amountOfMoneyTotal'].is_a? Hash @amount_of_money_total = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoneyTotal']) end if hash.has_key? 'frequencyOfInstallments' @frequency_of_installments = hash['frequencyOfInstallments'] end if hash.has_key? 'installmentPlanCode' @installment_plan_code = hash['installmentPlanCode'] end if hash.has_key? 'interestRate' @interest_rate = hash['interestRate'] end if hash.has_key? 'numberOfInstallments' @number_of_installments = hash['numberOfInstallments'] end end |
#to_h ⇒ Hash
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/ingenico/connect/sdk/domain/payment/installments.rb', line 33 def to_h hash = super hash['amountOfMoneyPerInstallment'] = @amount_of_money_per_installment.to_h unless @amount_of_money_per_installment.nil? hash['amountOfMoneyTotal'] = @amount_of_money_total.to_h unless @amount_of_money_total.nil? hash['frequencyOfInstallments'] = @frequency_of_installments unless @frequency_of_installments.nil? hash['installmentPlanCode'] = @installment_plan_code unless @installment_plan_code.nil? hash['interestRate'] = @interest_rate unless @interest_rate.nil? hash['numberOfInstallments'] = @number_of_installments unless @number_of_installments.nil? hash end |