Class: Transformer::Lazy::Yielder
Instance Method Summary collapse
- #await ⇒ Object
- #define_yield(&block) ⇒ Object
-
#initialize(wrapped) ⇒ Yielder
constructor
A new instance of Yielder.
Constructor Details
#initialize(wrapped) ⇒ Yielder
Returns a new instance of Yielder.
256 257 258 |
# File 'lib/coroutines/base.rb', line 256 def initialize(wrapped) @wrapped = wrapped end |
Instance Method Details
#await ⇒ Object
259 260 261 |
# File 'lib/coroutines/base.rb', line 259 def await @wrapped.await end |
#define_yield(&block) ⇒ Object
263 264 265 266 267 268 |
# File 'lib/coroutines/base.rb', line 263 def define_yield(&block) singleton_class.instance_eval do define_method(:yield, &block) alias_method :<<, :yield end end |