Class: Mingle::MingleBoolean
- Inherits:
-
MingleValue
- Object
- BitGirderClass
- MingleValue
- Mingle::MingleBoolean
- Extended by:
- Forwardable
- Defined in:
- lib/mingle.rb
Constant Summary collapse
- TRUE =
new( true )
- FALSE =
new( false )
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #as_boolean ⇒ Object (also: #to_b, #to_bool, #to_boolean)
-
#initialize(b) ⇒ MingleBoolean
constructor
A new instance of MingleBoolean.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(b) ⇒ MingleBoolean
Returns a new instance of MingleBoolean.
94 95 96 |
# File 'lib/mingle.rb', line 94 def initialize( b ) @b = b end |
Class Method Details
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
118 119 120 |
# File 'lib/mingle.rb', line 118 def ==( other ) other.is_a?( MingleBoolean ) && @b == other.as_boolean end |
#as_boolean ⇒ Object Also known as: to_b, to_bool, to_boolean
109 110 111 |
# File 'lib/mingle.rb', line 109 def as_boolean @b end |
#inspect ⇒ Object
104 105 106 |
# File 'lib/mingle.rb', line 104 def inspect to_s.inspect end |
#to_s ⇒ Object
99 100 101 |
# File 'lib/mingle.rb', line 99 def to_s @b.to_s end |