Class: Fluent::ArrayEventStream
- Inherits:
-
EventStream
- Object
- EventStream
- Fluent::ArrayEventStream
- Defined in:
- lib/fluent/event.rb
Overview
EventStream from entries: Array of [time, record]
Use this class for many events data with a tag and its representation is [ [time, record], [time, record], .. ]
Instance Method Summary collapse
- #dup ⇒ Object
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(entries) ⇒ ArrayEventStream
constructor
A new instance of ArrayEventStream.
- #repeatable? ⇒ Boolean
Methods inherited from EventStream
Constructor Details
#initialize(entries) ⇒ ArrayEventStream
Returns a new instance of ArrayEventStream.
64 65 66 |
# File 'lib/fluent/event.rb', line 64 def initialize(entries) @entries = entries end |
Instance Method Details
#dup ⇒ Object
68 69 70 71 |
# File 'lib/fluent/event.rb', line 68 def dup entries = @entries.map { |entry| entry.dup } # @entries.map(:dup) doesn't work by ArgumentError ArrayEventStream.new(entries) end |
#each(&block) ⇒ Object
81 82 83 84 |
# File 'lib/fluent/event.rb', line 81 def each(&block) @entries.each(&block) nil end |
#empty? ⇒ Boolean
77 78 79 |
# File 'lib/fluent/event.rb', line 77 def empty? @entries.empty? end |
#repeatable? ⇒ Boolean
73 74 75 |
# File 'lib/fluent/event.rb', line 73 def repeatable? true end |