0.0
No commit activity in last 3 years
No release in over 3 years
A very simple salary calculator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0
~> 3.2
 Project Readme

SalaryCalc

Gem Version Build Status Coverage Status Dependency Status Code Climate

A very simple salary calculator.

Installation

Add this line to your application's Gemfile:

gem 'salary_calc'

And then execute:

$ bundle

Or install it yourself as:

$ gem install salary_calc

Usage

Calculating based on an hourly rate, and default 8 billable hours:

require 'salary_calc'

calculator = SalaryCalc::Calculator.new(15)
calculator.to_daily   #=> 120
calculator.to_weekly  #=> 600
calculator.to_monthly #=> 2400
calculator.to_yearly  #=> 28800

Specify billable hours:

calculator = SalaryCalc::Calculator.new(15, 6)
calculator.to_daily = 90

Getting the hourly rate for a specific amount different that hourly rate:

calculator = SalaryCalc::Calculator.new(15)
calculator.from_yearly(2500)

Getting and setting the hourly rate to amount inside the calculator:

calculator = SalaryCalc::Calculator.new(2400)
calculator.amount #=> 2400
calculator.from_monthly!
calculator.amount #=> 15

Take a look at the tests for more use cases. ;)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request