Skip to content

yez/ruby-boolean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages