Class: Transformer::Lazy::Yielder

Inherits:
Object
  • Object
show all
Defined in:
lib/coroutines/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(wrapped) ⇒ Yielder

Returns a new instance of Yielder.



255
256
257
# File 'lib/coroutines/base.rb', line 255

def initialize(wrapped)
	@wrapped = wrapped
end

Instance Method Details

#awaitObject



258
259
260
# File 'lib/coroutines/base.rb', line 258

def await
	@wrapped.await
end

#define_yield(&block) ⇒ Object



262
263
264
265
266
267
# File 'lib/coroutines/base.rb', line 262

def define_yield(&block)
	singleton_class.instance_eval do
		define_method(:yield, &block)
		alias_method :<<, :yield
	end
end