Class: Reru::EnumerableStream

Inherits:
Stream
  • Object
show all
Defined in:
lib/reru/enumerable_stream.rb

Instance Method Summary collapse

Methods inherited from Stream

#consume, #dispatch, #emit, #log, #map, #merge, #select, #to_es

Constructor Details

#initialize(enumerable) ⇒ EnumerableStream

Returns a new instance of EnumerableStream.



6
7
8
# File 'lib/reru/enumerable_stream.rb', line 6

def initialize(enumerable)
  @enumerable = enumerable
end

Instance Method Details

#runObject



10
11
12
13
# File 'lib/reru/enumerable_stream.rb', line 10

def run
  @enumerable.each { |value| emit(Reru::Next.new(value)) }
  emit(Reru::EOS)
end