class Mambu::LoanSchedule
Attributes
repayments[RW]
Public Class Methods
api_uri()
click to toggle source
# File lib/mambu/loan_schedule.rb, line 19 def self.api_uri Mambu::LoanProduct.api_uri end
find(loan_product, options, connection)
click to toggle source
# File lib/mambu/loan_schedule.rb, line 10 def self.find(loan_product, options, connection) response = connection.get( "#{endpoint(connection)}/#{loan_product.id}/schedule", camelize_hash(options) ) handle_error(response) new(response.body) end
Public Instance Methods
repayments=(data)
click to toggle source
# File lib/mambu/loan_schedule.rb, line 6 def repayments=(data) @repayments = data.map { |hash_fee| Mambu::Repayment.new(hash_fee) } end
total(property)
click to toggle source
# File lib/mambu/loan_schedule.rb, line 23 def total(property) @repayments.map(&property).inject(0, &:+) end