to_boolean
Ruby core extension that converts string and integer values to boolean.
Installation
In your Gemfile:
gem 'to_boolean'
Install gem manually:
$ gem install to_boolean
Usage
'true'.to_boolean #=> true
1.to_boolean #=> true
'false'.to_boolean #=> false
0.to_boolean #=> false
See more from spec/spec_to_boolean.rb.
Run the tests
$ bundle
$ bundle exec rake
License
MIT