Class: FalseClass
Overview
The global value false is the only instance of class FalseClass and represents a logically false value in boolean expressions. The class provides operators allowing false to participate correctly in logical expressions.
Instance Method Summary collapse
-
#&(object) ⇒ Object
call-seq: false & obj -> false.
-
#^(object) ⇒ Object
call-seq: false ^ obj -> !!obj.
-
#hash ⇒ Object
:nodoc:.
-
#object_id ⇒ Object
:nodoc:.
-
#to_s ⇒ Object
call-seq: false.to_s -> “false”.
-
#|(object) ⇒ Object
call-seq: false | obj -> !!obj.
Instance Method Details
#&(object) ⇒ Object
call-seq:
false & obj -> false
And – returns false. Because obj is the argument to a method call, it is always evaluated; there is no short-circuit evaluation.
false & a = "A assigned" #=> false
false && b = "B assigned" #=> false
[a, b].inspect #=> ["A assigned", nil]
2962 2963 2964 |
# File 'lib/source/ruby.rb', line 2962 def &(object) # `this.valueOf()&&$T(object)` // implemented in TrueClass end |
#^(object) ⇒ Object
call-seq:
false ^ obj -> !!obj
Exclusive Or – returns false if obj is nil or false, true otherwise.
2981 2982 2983 |
# File 'lib/source/ruby.rb', line 2981 def ^(object) # `this.valueOf()?!$T(object):$T(object)` // implemented in TrueClass end |
#hash ⇒ Object
:nodoc:
2985 2986 2987 |
# File 'lib/source/ruby.rb', line 2985 def hash # :nodoc: # `'b_'+this.valueOf()` // implemented in TrueClass end |
#object_id ⇒ Object
:nodoc:
2989 2990 2991 |
# File 'lib/source/ruby.rb', line 2989 def object_id # :nodoc: # `this.valueOf()?2:0` // implemented in TrueClass end |
#to_s ⇒ Object
call-seq:
false.to_s -> "false"
The string representation of false is “false”.
2998 2999 3000 |
# File 'lib/source/ruby.rb', line 2998 def to_s # `$q(''+this)` // implemented in TrueClass end |
#|(object) ⇒ Object
call-seq:
false | obj -> !!obj
Or – returns false if obj is nil or false, true otherwise.
2971 2972 2973 |
# File 'lib/source/ruby.rb', line 2971 def |(object) # `this.valueOf()||$T(object)` // implemented in TrueClass end |