lib/effective_interest_rate/payment.rb
# Takes a reference payment and returns a relative payment (relative
# to the given reference payment) corresponding to the current
# payment
# @param reference_payment [Payment] the reference payment
# @return [RelativePayment] a relative payment (relative to the
#   given reference payment) corresponding to the current payment
Takes a reference payment and returns a relative payment (relative
to the given reference payment) corresponding to the current
payment
Takes a reference payment and returns a relative payment ( relative to the given reference payment ) corresponding to the current payment
def to_relative_payment(reference_payment)
    RelativePayment.new(
      amount,
      (date.year - reference_payment.date.year) +
      (offset_in_year - reference_payment.offset_in_year)
    )
  end
def to_relative_payment ( reference_payment ) RelativePayment . new ( amount , ( date . year - reference_payment . date . year ) + ( offset_in_year - reference_payment . offset_in_year ) ) end
Takes a reference payment and returns a relative payment (relative
to the given reference payment) corresponding to the current
payment
Takes a reference payment and returns a relative payment ( relative to the given reference payment ) corresponding to the current payment
a relative payment (relative to the given reference payment) corresponding to the current payment
a relative payment ( relative to the given reference payment ) corresponding to the current payment
RelativePayment
reference_payment
the reference payment
the reference payment