Created
February 2, 2009 00:49
-
-
Save tbbooher/56712 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "date" | |
| require 'rubygems' | |
| require 'action_view' | |
| class FinancialYear | |
| attr :salary, true | |
| attr :year, true | |
| def initialize(salary, year=Date.today.year, state_of_residence = "VA") | |
| @year = year | |
| @salary = salary | |
| @state_of_residence = state_of_residence | |
| end | |
| def increase_salary(increase_percentage) | |
| @salary *= 1+increase_percentage.to_f/100 | |
| end | |
| def federal_income_tax | |
| puts "this will be x% of #{@salary}" | |
| end | |
| def increment_year | |
| @year += 1 | |
| end | |
| def salary | |
| ActionView::Helpers::NumberHelper.number_to_currency(@salary) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment