Class: NullClass

Class | NullClass
In: | lib/more/facets/nullclass.rb
Parent: | Object

# Nullclass

NullClass is essentially NilClass but it differs in one important way. When a method is called against it that it deoesn‘t have, it will simply return null value rather then raise an error.

TODO: Perhaps NullClass and NackClass should be one and the same?

### Methods

[] inspect method_missing new nil? null?

### Public Class methods

new()

[Source]

    # File lib/more/facets/nullclass.rb, line 36
        def new
          @null ||= NullClass.allocate
        end

### Public Instance methods

[](key)

[Source]

    # File lib/more/facets/nullclass.rb, line 43
      def [](key); nil; end

inspect()

[Source]

    # File lib/more/facets/nullclass.rb, line 40
      def inspect ; 'null' ; end

method_missing(sym, *args)

[Source]

    # File lib/more/facets/nullclass.rb, line 44
      def method_missing(sym, *args)
        return nil if sym.to_s[-1,1] == '?'
        self
      end

nil?()

[Source]

    # File lib/more/facets/nullclass.rb, line 41
      def nil?  ; true ; end

null?()

[Source]

    # File lib/more/facets/nullclass.rb, line 42
      def null? ; true ; end

[Validate]