Parent

NilClass

Core Extensions

Public Instance Methods

blank?() click to toggle source
    # File lib/core/facets/blank.rb, line 20
20:   def blank?
21:     true
22:   end
clone?() click to toggle source
    # File lib/core/facets/duplicable.rb, line 10
10:   def clone? ; false ; end
dup?() click to toggle source
   # File lib/core/facets/duplicable.rb, line 9
9:   def dup?   ; false ; end
ergo() click to toggle source

Compliments Kernel#ergo.

  "a".ergo{ |o| o.upcase } #=> "A"
  nil.ergo{ |o| o.bar } #=> nil

CREDIT: Daniel DeLorme

    # File lib/core/facets/kernel/ergo.rb, line 36
36:   def ergo
37:     @_ergo ||= Functor.new{ nil }
38:     @_ergo unless block_given?
39:   end
to_bool() click to toggle source
    # File lib/core/facets/boolean.rb, line 81
81:   def to_bool
82:     false
83:   end
to_f() click to toggle source

Allows nil to respond to #. Always returns 0.

  nil.to_f   #=> 0.0

CREDIT: Matz

    # File lib/core/facets/nilclass/to_f.rb, line 12
12:     def to_f; 0.0; end
to_h() click to toggle source

Allows nil to create an empty hash, similar to # and #.

  nil.to_h    #=> {}

CREDIT: Trans

     # File lib/core/facets/to_hash.rb, line 264
264:   def to_h; {}; end
to_openobject() click to toggle source

Nil converts to an empty OpenObject.

     # File lib/more/facets/openobject.rb, line 233
233:   def to_openobject
234:     OpenObject.new
235:   end
to_path() click to toggle source

Provide platform dependent null path.

CREDIT Daniel Burger

     # File lib/more/facets/pathname.rb, line 225
225:   def to_path
226:     Pathname.null
227:   end
try_dup() click to toggle source

Since NilClass is immutable it cannot be duplicated. For this reason # returns self.

    # File lib/core/facets/kernel/try_dup.rb, line 35
35:   def try_dup
36:     self
37:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.