Class: Enumerator::Yielder
Overview
Wrapper to allow yielder.yield(output) or yielder << output in the same way as ruby-1.9
TODO: Why can’t Yielder take a block instead of a proc argument?
Instance Method Summary collapse
-
#initialize(&proc) ⇒ Yielder
constructor
:nodoc:.
- #yield(*args) ⇒ Object (also: #<<)
Constructor Details
#initialize(&proc) ⇒ Yielder
:nodoc:
56 57 58 |
# File 'lib/core/facets/enumerator.rb', line 56 def initialize(&proc) @proc = proc end |
Instance Method Details
#yield(*args) ⇒ Object Also known as: <<
59 60 61 |
# File 'lib/core/facets/enumerator.rb', line 59 def yield(*args) @proc[*args] end |