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/standard/facets/ostruct.rb lib/standard/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

blank?()
clone?()
dup!()

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

      nil.dup!  #=> nil

dup?()
ergo()

Compliments Kernel#ergo.

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

CREDIT: Daniel DeLorme

to_bool()
to_f()

Allows `nil` to respond to to_f. Always returns `0`.

      nil.to_f   #=> 0.0

CREDIT: Matz

to_h()

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

      nil.to_h    #=> {}

CREDIT: Trans

to_ostruct()

Create an empty OpenStruct object.

to_path()

Provide platform dependent null path.

CREDIT Daniel Burger

try(method=nil, *args)

See Kernel#try.

[Validate]