Module: SalaryCalc::Conversions::ToHourly

Included in:
SalaryCalc::Calculator
Defined in:
lib/salary_calc/conversions/to_hourly.rb

Instance Method Summary collapse

Instance Method Details

#from_daily(daily) ⇒ Object



15
16
17
# File 'lib/salary_calc/conversions/to_hourly.rb', line 15

def from_daily(daily)
  daily / billable_hours.to_f
end

#from_monthly(monthly) ⇒ Object



7
8
9
# File 'lib/salary_calc/conversions/to_hourly.rb', line 7

def from_monthly(monthly)
  from_weekly(monthly.to_f / 4)
end

#from_weekly(weekly) ⇒ Object



11
12
13
# File 'lib/salary_calc/conversions/to_hourly.rb', line 11

def from_weekly(weekly)
  from_daily(weekly.to_f / 5)
end

#from_yearly(yearly) ⇒ Object



3
4
5
# File 'lib/salary_calc/conversions/to_hourly.rb', line 3

def from_yearly(yearly)
  from_monthly(yearly.to_f / 12)
end