Class NilClass
In: lib/facet/nil-missing.rb
lib/facet/nil-comparable.rb
Parent: Object

Description

NilComparable does two things. First it make nil comparable, such that all things (except itself) are greater than it.

Secondly it provides a module called NilComparable to include into any other class to allow it to compare itself to NilClass as the greater of the two.

Author(s)

  • Paul Brannan
  • Thomas Sawyer

Methods

<=>   cmp   method_missing  

Included Modules

Comparable

Public Instance methods

cmp(x)

Alias for #<=>

Have nil respond to all non-existent methods, always returning nil.

 require 'facet/nil/nil_missing'

 nil.foo   #=> nil

[Validate]