Project

boolean2

0.0
No commit activity in last 3 years
No release in over 3 years
A global Boolean2 constant that is an ancestor of true and false. Useful for coercion libraries.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Boolean2 [version] [ci]

Next time before you want to define a global Boolean class, consider using this bare-bones approach instead.

Setup

Add to your Gemfile:

gem 'boolean2'

Usage

true.is_a? Boolean2 #=> true
false.is_a? Boolean2 #=> true
nil.is_a? Boolean2 #=> false
Object.new.is_a? Boolean2 #=> false

true.to_boolean2 #=> true
false.to_boolean2 #=> false
nil.to_boolean2 #=> false
Object.new.to_boolean2 #=> true

Boolean2.new(true) #=> true
Boolean2.new(false) #=> false
Boolean2.new(nil) #=> false
Boolean2.new(Object.new) #=> true

J-_-L

Copyright (C) 2015 Jan Lelis https://janlelis.com. Released under the MIT license.