Skip to content

Instantly share code, notes, and snippets.

@tbbooher
Created February 2, 2009 00:49
Show Gist options
  • Select an option

  • Save tbbooher/56712 to your computer and use it in GitHub Desktop.

Select an option

Save tbbooher/56712 to your computer and use it in GitHub Desktop.
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