Skip to content

About

Boolean Type for Ruby

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

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

About

Boolean Type for Ruby

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages