Class: NilClass

Inherits:
Object show all
Includes:
Falsiness
Defined in:
lib/null.rb

Overview

Make boolean logic work with truthiness. Note that this makes these operators asymmetric in that calling boolean operators on null will return null.

Instance Method Summary collapse

Methods included from Falsiness

#!, #falsy?, #truthy?

Instance Method Details

#&(obj) ⇒ Object



61
# File 'lib/null.rb', line 61

def     &(obj) false end

#^(obj) ⇒ Object



63
# File 'lib/null.rb', line 63

def     ^(obj) !!obj end

#to_null?Boolean

Returns:

  • (Boolean)


64
# File 'lib/null.rb', line 64

def to_null?() null end

#|(obj) ⇒ Object



62
# File 'lib/null.rb', line 62

def     |(obj) !!obj end