Class: Worldline::Connect::SDK::V1::Domain::Installments

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/installments.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#amount_of_money_per_installmentWorldline::Connect::SDK::V1::Domain::AmountOfMoney

Returns the current value of amount_of_money_per_installment.

Returns:



19
20
21
# File 'lib/worldline/connect/sdk/v1/domain/installments.rb', line 19

def amount_of_money_per_installment
  @amount_of_money_per_installment
end

#amount_of_money_totalWorldline::Connect::SDK::V1::Domain::AmountOfMoney

Returns the current value of amount_of_money_total.

Returns:



19
20
21
# File 'lib/worldline/connect/sdk/v1/domain/installments.rb', line 19

def amount_of_money_total
  @amount_of_money_total
end

#frequency_of_installmentsString

Returns the current value of frequency_of_installments.

Returns:

  • (String)

    the current value of frequency_of_installments



19
20
21
# File 'lib/worldline/connect/sdk/v1/domain/installments.rb', line 19

def frequency_of_installments
  @frequency_of_installments
end

#installment_plan_codeInteger

Returns the current value of installment_plan_code.

Returns:

  • (Integer)

    the current value of installment_plan_code



19
20
21
# File 'lib/worldline/connect/sdk/v1/domain/installments.rb', line 19

def installment_plan_code
  @installment_plan_code
end

#interest_rateString

Returns the current value of interest_rate.

Returns:

  • (String)

    the current value of interest_rate



19
20
21
# File 'lib/worldline/connect/sdk/v1/domain/installments.rb', line 19

def interest_rate
  @interest_rate
end

#number_of_installmentsInteger

Returns the current value of number_of_installments.

Returns:

  • (Integer)

    the current value of number_of_installments



19
20
21
# File 'lib/worldline/connect/sdk/v1/domain/installments.rb', line 19

def number_of_installments
  @number_of_installments
end

Instance Method Details

#from_hash(hash) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/worldline/connect/sdk/v1/domain/installments.rb', line 45

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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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_hHash

Returns:

  • (Hash)


34
35
36
37
38
39
40
41
42
43
# File 'lib/worldline/connect/sdk/v1/domain/installments.rb', line 34

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