Class: NilClass

Inherits:
Object show all
Defined in:
lib/dolzenko/core_ext/kernel/ergo.rb

Instance Method Summary collapse

Instance Method Details

#ergoObject

Compliments Kernel#ergo.

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

CREDIT: Daniel DeLorme



34
35
36
37
# File 'lib/dolzenko/core_ext/kernel/ergo.rb', line 34

def ergo
  @_ergo ||= Functor.new{ nil }
  @_ergo unless block_given?
end