Class: Fluent::Compat::OutputChain

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/compat/output_chain.rb

Direct Known Subclasses

CopyOutputChain

Instance Method Summary collapse

Constructor Details

#initialize(array, tag, es, chain = NullOutputChain.instance) ⇒ OutputChain

Returns a new instance of OutputChain.



30
31
32
33
34
35
36
# File 'lib/fluent/compat/output_chain.rb', line 30

def initialize(array, tag, es, chain=NullOutputChain.instance)
  @array = array
  @tag = tag
  @es = es
  @offset = 0
  @chain = chain
end

Instance Method Details

#nextObject



38
39
40
41
42
43
44
45
# File 'lib/fluent/compat/output_chain.rb', line 38

def next
  if @array.length <= @offset
    return @chain.next
  end
  @offset += 1
  @array[@offset-1].emit_events(@tag, @es)
  self.next
end