Skip to content
A Ruby gem for calculating Roth IRA contribution amounts
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.gitignore
.rspec
.ruby-version
Gemfile
Gemfile.lock
LICENSE
README.md
roth_ira.gemspec

README.md

CircleCI Gem Version Code Climate

roth_ira

This Ruby gem allows you to calculate maximum Roth IRA contributions based on Modified Adjusted Gross Income (MAGI), Age, Filing Status, and Tax Year. Guidelines for these calculations were taken from the IRS Publications on Roth IRAs.

Contribution and income limits may vary every year, and thus changes to the code will be required. This gem is currently up to date for Tax Years 2015 - 2017.

Installation

In your gemfile, add

gem 'roth_ira', '~> 1.2.0'

then run bundle install.

Alternatively, you can manually install the gem.

gem install roth_ira

Usage

Version 1.0+

To calculate a contribution limit, initialize a new RothIRA object with the tax year. Then, call calculate_limit, and pass MAGI, filing status, age, and (optionally) spouse age.

> roth_ira = RothIRA.new(2017)
> roth_ira.calculate(75000, :single, 25)
5500
> RothIRA.calculate(75000, :married_filing_jointly, 25)
11000

Older versions

Next, call the method RothIRA.calculate_limit and pass four parameters: MAGI, filing status as a symbol (:single, :married_filing_jointly), age, and (optionally) spouse's age.

RothIRA.calculate_limit(75000, :single, 25)
> 5500
RothIRA.calculate_limit(75000, :married_filing_jointly, 49)
> 11000
RothIRA.calculate_limit(75000, :married_filing_jointly, 49, 50)
> 12000

Version Note

roth_ira follows semantic versioning. New with version 1.0.0, year is no longer an optional parameter and must be specified. Additionally, implementation has shifted from module methods to class instance methods.

You can’t perform that action at this time.