Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Ruby Kata to teach converting bunches of "if" statements to something better

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Rakefile
Octocat-spinner-32 user_permissions.rb

Getting Iffy - A Ruby Kata


You must refactor the beast that lies beneath the authorization mechanism of an invoice system. You are new to the project. All you see is a sea of "if" statements. Your task: Make the if statements go away.

The code is real. It was at the bottom of our construction management invoice system that has handled billions of dollars of construction. I have graciously been given permission by my supervisor to use it for this lesson. Enjoy!


The kata was written with Ruby 1.9.3 and expects Minitest and SimpleCov. Use 'bundle' to get everything just so. A default rake task will run the tests and create a coverage report. No fair changing the tests or modifying the stubbed-out classes and methods.


Under Apache 2.0 license.

Something went wrong with that request. Please try again.