0.01
No commit activity in last 3 years
No release in over 3 years
A way to handle booleans in a terse way for a specific use case.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.0
 Project Readme

Ruby Boolean

Build Status

This is an extremely simple addition of a Boolean module.

Install:

gem install 'ruby-boolean'

or in your Gemfile

gem 'ruby-boolean'

Its purpose to avoid doing:

foo = true
if foo.is_a?(TrueClass) || foo.is_a?(FalseClass)
  # do something that's specific to booleans
end

Now it can be reduced to:

require 'ruby-boolean'

true.is_a?(Boolean)  #=> true
false.is_a?(Boolean) #=> true
"foo".is_a?(Boolean) #=> false