Class: Fluent::MultiEventStream
- Inherits:
-
EventStream
- Object
- EventStream
- Fluent::MultiEventStream
- Defined in:
- lib/fluent/event.rb
Instance Method Summary collapse
- #add(time, record) ⇒ Object
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize ⇒ MultiEventStream
constructor
A new instance of MultiEventStream.
- #repeatable? ⇒ Boolean
Methods inherited from EventStream
Constructor Details
#initialize ⇒ MultiEventStream
Returns a new instance of MultiEventStream.
85 86 87 88 |
# File 'lib/fluent/event.rb', line 85 def initialize @time_array = [] @record_array = [] end |
Instance Method Details
#add(time, record) ⇒ Object
90 91 92 93 |
# File 'lib/fluent/event.rb', line 90 def add(time, record) @time_array << time @record_array << record end |
#each(&block) ⇒ Object
103 104 105 106 107 108 109 110 |
# File 'lib/fluent/event.rb', line 103 def each(&block) time_array = @time_array record_array = @record_array for i in 0..time_array.length-1 block.call(time_array[i], record_array[i]) end nil end |
#empty? ⇒ Boolean
99 100 101 |
# File 'lib/fluent/event.rb', line 99 def empty? @time_array.empty? end |
#repeatable? ⇒ Boolean
95 96 97 |
# File 'lib/fluent/event.rb', line 95 def repeatable? true end |