Fix for Ruby 1.9.2 Syntax Change Problem

This case/when syntax is no longer supported in Ruby 1.9.2. Changed it so it should work with any Ruby. See this blog post comment for more info on the Ruby 1.9.2 change that causes it... 

http://blog.grayproductions.net/articles/getting_code_ready_for_ruby_19#comment_1010