Class: CiPower::InstallmentPlan

Inherits:
Record
  • Object
show all
Defined in:
lib/ci_power/installment_plan.rb

Instance Attribute Summary collapse

Attributes inherited from Record

#address_identification_debtee, #address_identification_debtor, #group_no, #record_type

Instance Method Summary collapse

Methods inherited from Record

#cip_default_data, #fill_up, #line_terminator

Constructor Details

#initialize(attributes = {}) ⇒ InstallmentPlan

Returns a new instance of InstallmentPlan.



12
13
14
15
16
17
18
19
# File 'lib/ci_power/installment_plan.rb', line 12

def initialize(attributes = {})
  if attributes.is_a? Hash
    attributes.merge! :record_type => '15'
    attributes.each do |key, value|
      self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
    end
  end
end

Instance Attribute Details

#first_installment_dateObject

Returns the value of attribute first_installment_date.



3
4
5
# File 'lib/ci_power/installment_plan.rb', line 3

def first_installment_date
  @first_installment_date
end

#fixed_size_installment_amountObject

Returns the value of attribute fixed_size_installment_amount.



3
4
5
# File 'lib/ci_power/installment_plan.rb', line 3

def fixed_size_installment_amount
  @fixed_size_installment_amount
end

#installment_amountObject

Returns the value of attribute installment_amount.



3
4
5
# File 'lib/ci_power/installment_plan.rb', line 3

def installment_amount
  @installment_amount
end

#installment_feeObject

Returns the value of attribute installment_fee.



3
4
5
# File 'lib/ci_power/installment_plan.rb', line 3

def installment_fee
  @installment_fee
end

#intervalObject

Returns the value of attribute interval.



3
4
5
# File 'lib/ci_power/installment_plan.rb', line 3

def interval
  @interval
end

#last_installment_dateObject

Returns the value of attribute last_installment_date.



3
4
5
# File 'lib/ci_power/installment_plan.rb', line 3

def last_installment_date
  @last_installment_date
end

#no_of_installmentsObject

Returns the value of attribute no_of_installments.



3
4
5
# File 'lib/ci_power/installment_plan.rb', line 3

def no_of_installments
  @no_of_installments
end

#periodObject

Returns the value of attribute period.



3
4
5
# File 'lib/ci_power/installment_plan.rb', line 3

def period
  @period
end

Instance Method Details

#to_cip(with_line_terminator = true) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/ci_power/installment_plan.rb', line 21

def to_cip(with_line_terminator = true)
  fill_up(
    {
      :record_type => 2,
      :group_no => 7,
      :address_identification_debtee => 25,
      :address_identification_debtor => 25,
      :no_of_installments => 3,
      :installment_amount => 15,
      :first_installment_date => 10,
      :period => 10,
      :interval => 3,
      :installment_fee => 15,
      :fixed_size_installment_amount => 1,
      :last_installment_date => 10
    }, with_line_terminator
  )
end