Class NilClass
In: lib/core/facets/boolean.rb
lib/core/facets/kernel/blank.rb
lib/core/facets/kernel/ergo.rb
lib/core/facets/kernel/try.rb
lib/core/facets/nilclass/to_f.rb
lib/core/facets/object/dup.rb
lib/core/facets/to_hash.rb
lib/more/facets/ostruct.rb
lib/more/facets/pathname.rb
Parent: Object

Methods

blank?   clone?   dup!   dup?   ergo   to_bool   to_f   to_h   to_ostruct   to_path   try  

Public Instance methods

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

  nil.dup!  #=> nil

Compliments Kernel#ergo.

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

CREDIT: Daniel DeLorme

Allows nil to respond to to_f. Always returns 0.

  nil.to_f   #=> 0.0

CREDIT: Matz

Allows nil to create an empty hash, similar to to_a and to_s.

  nil.to_h    #=> {}

CREDIT: Trans

Create an empty OpenStruct object.

Provide platform dependent null path.

CREDIT Daniel Burger

See Kernel#try.

[Validate]