class RealEstateFinance::GrossOperatingIncome
Attributes
estimated_loss_percentage[R]
monthly_income[R]
Public Class Methods
new(monthly_income, estimated_loss_percentage)
click to toggle source
# File lib/real_estate_finance/gross_operating_income.rb, line 6 def initialize(monthly_income, estimated_loss_percentage) @monthly_income = monthly_income @estimated_loss_percentage = estimated_loss_percentage end
Public Instance Methods
gross_operating_income()
click to toggle source
# File lib/real_estate_finance/gross_operating_income.rb, line 11 def gross_operating_income agi = sprintf("%0.02f", (@monthly_income * 12)).to_f loss_percentage = sprintf("%0.02f", @estimated_loss_percentage.to_i / (100.to_f)).to_f estimated_loss = sprintf("%0.02f", (agi * loss_percentage)).to_f end