Class: SalaryCalc::Calculator

Inherits:
Object
  • Object
show all
Includes:
SalaryCalc::Conversions::FromHourly, SalaryCalc::Conversions::ToHourly
Defined in:
lib/salary_calc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SalaryCalc::Conversions::ToHourly

#from_daily, #from_monthly, #from_weekly, #from_yearly

Methods included from SalaryCalc::Conversions::FromHourly

#to_daily, #to_monthly, #to_weekly, #to_yearly

Constructor Details

#initialize(amount, billable_hours = 8) ⇒ Calculator

Returns a new instance of Calculator.



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

def initialize(amount, billable_hours = 8)
  @amount         = amount
  @billable_hours = billable_hours
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



9
10
11
# File 'lib/salary_calc.rb', line 9

def amount
  @amount
end

#billable_hoursObject

Returns the value of attribute billable_hours.



9
10
11
# File 'lib/salary_calc.rb', line 9

def billable_hours
  @billable_hours
end

Instance Method Details

#to_hourlyObject



16
17
18
# File 'lib/salary_calc.rb', line 16

def to_hourly
  amount
end