Class: RVM::Classes::Boolean
Instance Method Summary collapse
- #data_type ⇒ Object
- #eql?(o) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(value) ⇒ Boolean
constructor
A new instance of Boolean.
- #is_true? ⇒ Boolean
Methods inherited from Class
#functions, #method_missing, #variables
Methods included from Plugin
#helper, #included, #plugin_host, #plugin_id, #register_for
Constructor Details
#initialize(value) ⇒ Boolean
Returns a new instance of Boolean.
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rvm/classes/boolean.rb', line 22 def initialize value super() if value if value.respond_to? :is_true? @value = value.is_true? else @value = true end else @value = false end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RVM::Classes::Class
Instance Method Details
#data_type ⇒ Object
6 7 8 |
# File 'lib/rvm/classes/boolean.rb', line 6 def data_type :boolean end |
#eql?(o) ⇒ Boolean
14 15 16 17 18 19 20 |
# File 'lib/rvm/classes/boolean.rb', line 14 def eql?(o) if o.is_a?(RVM::Classes::Boolean) o.is_true? == is_true? else @value == o end end |
#hash ⇒ Object
10 11 12 |
# File 'lib/rvm/classes/boolean.rb', line 10 def hash @value.hash end |