Post Image
By Matt GaidicaJuly 7, 2012In Uncategorized

String to Boolean in Ruby

A great couple of lines that add a `to_bool` method to the Ruby String class. This is really helpful when passing in boolean values from a query string (like in an API). Just put this in a file and require it!

svgrspec_helper.rb for Rspec in Ruby
svg
svgThe Stanford Natural Language Processing Group