Class NilClass
In: lib/core/facets/blank.rb
lib/core/facets/boolean.rb
lib/core/facets/duplicable.rb
lib/core/facets/kernel/ergo.rb
lib/core/facets/nilclass/to_f.rb
lib/core/facets/to_hash.rb
lib/more/facets/openobject.rb
lib/more/facets/pathname.rb
Parent: Object

Core Extensions

Methods

blank?   clone?   dup?   ergo   to_bool   to_f   to_h   to_openobject   to_path  

Public Instance methods

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

Nil converts to an empty OpenObject.

Provide platform dependent null path.

CREDIT Daniel Burger

[Validate]