roth_ira

Determines max Roth IRA contribution amount based on year, filing status, and MAGI


License
MIT
Install
gem install roth_ira -v 1.2.4

Documentation

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 - 2019.

Installation

In your gemfile, add

gem 'roth_ira', '~> 1.2.2'

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.