Class: Vedeu::Boolean Private
- Inherits:
-
Object
- Object
- Vedeu::Boolean
- Defined in:
- lib/vedeu/boolean.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represent a boolean object.
Instance Attribute Summary collapse
- #value ⇒ void readonly private private
Class Method Summary collapse
- .coerce(value = nil) ⇒ Boolean private
Instance Method Summary collapse
- #coerce ⇒ Boolean private
- #false? ⇒ Boolean private
- #initialize(value = nil) ⇒ Vedeu::Boolean constructor private
- #true? ⇒ Boolean private
Constructor Details
#initialize(value = nil) ⇒ Vedeu::Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 |
# File 'lib/vedeu/boolean.rb', line 18 def initialize(value = nil) @value = value end |
Instance Attribute Details
#value ⇒ void (readonly, private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
43 44 45 |
# File 'lib/vedeu/boolean.rb', line 43 def value @value end |
Class Method Details
.coerce(value = nil) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/vedeu/boolean.rb', line 12 def self.coerce(value = nil) new(value).coerce end |
Instance Method Details
#coerce ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/vedeu/boolean.rb', line 23 def coerce value ? true : false end |
#false? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 |
# File 'lib/vedeu/boolean.rb', line 28 def false? value.nil? || value == false end |
#true? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 36 37 |
# File 'lib/vedeu/boolean.rb', line 33 def true? return false if false? true end |