Sha256: 9d48b3c283de851b807c6a3f65ca4b798fd4e90ba2198710f46eb6aaeeb1a9cb

Contents?: true

Size: 557 Bytes

Versions: 4

Compression:

Stored size: 557 Bytes

Contents

module LoanCreator
  class InFine < LoanCreator::Common
    # InFine is the same as a Linear loan with (duration - 1) deferred periods.
    # Thus we're generating a Linear loan instead of rewriting already existing code.
    def lender_timetable
      raise ArgumentError.new(:deferred_in_periods) unless deferred_in_periods == 0
      options = { deferred_in_periods: duration_in_periods - 1 }
      options = REQUIRED_ATTRIBUTES.each_with_object(options) { |k,h| h[k] = send(k) }
      LoanCreator::Linear.new(options).lender_timetable
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
loan_creator-0.2.0 lib/loan_creator/in_fine.rb
loan_creator-0.2.1 lib/loan_creator/in_fine.rb
loan_creator-0.2.2 lib/loan_creator/in_fine.rb
loan_creator-0.2.3 lib/loan_creator/in_fine.rb