Class: FalseClass

Inherits:
Object show all
Defined in:
lib/source/ruby.rb

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

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]


3011
3012
3013
# File 'lib/source/ruby.rb', line 3011

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.



3030
3031
3032
# File 'lib/source/ruby.rb', line 3030

def ^(object)
  # `this.valueOf()?!$T(object):$T(object)` // implemented in TrueClass
end

#hashObject

:nodoc:



3034
3035
3036
# File 'lib/source/ruby.rb', line 3034

def hash # :nodoc:
  # `'b_'+this.valueOf()` // implemented in TrueClass
end

#object_idObject

:nodoc:



3038
3039
3040
# File 'lib/source/ruby.rb', line 3038

def object_id # :nodoc:
  # `this.valueOf()?2:0` // implemented in TrueClass
end

#to_sObject

call-seq:

false.to_s -> "false"

The string representation of false is “false”.



3047
3048
3049
# File 'lib/source/ruby.rb', line 3047

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.



3020
3021
3022
# File 'lib/source/ruby.rb', line 3020

def |(object)
  # `this.valueOf()||$T(object)` // implemented in TrueClass
end