Class: Mambu::LoanSchedule
- Extended by:
- Helpers
- Defined in:
- lib/mambu/loan_schedule.rb
Instance Attribute Summary collapse
-
#repayments ⇒ Object
Returns the value of attribute repayments.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Helpers
Methods inherited from ApiModel
#convert_decimal, endpoint, #initialize
Constructor Details
This class inherits a constructor from Mambu::ApiModel
Instance Attribute Details
#repayments ⇒ Object
Returns the value of attribute repayments.
3 4 5 |
# File 'lib/mambu/loan_schedule.rb', line 3 def repayments @repayments end |
Class Method Details
.api_uri ⇒ Object
19 20 21 |
# File 'lib/mambu/loan_schedule.rb', line 19 def self.api_uri Mambu::LoanProduct.api_uri end |
.find(loan_product, options, connection) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/mambu/loan_schedule.rb', line 10 def self.find(loan_product, , connection) response = connection.get( "#{endpoint(connection)}/#{loan_product.id}/schedule", camelize_hash() ) handle_error(response) new(response.body) end |
Instance Method Details
#total(property) ⇒ Object
23 24 25 |
# File 'lib/mambu/loan_schedule.rb', line 23 def total(property) @repayments.map(&property).inject(0, &:+) end |