Class: Fluent::OneEventStream
Instance Method Summary
collapse
Methods inherited from EventStream
#==, #to_compressed_msgpack_stream, #to_msgpack_stream, #to_msgpack_stream_forced_integer
#compress, #decompress
Constructor Details
Returns a new instance of OneEventStream.
80
81
82
83
|
# File 'lib/fluent/event.rb', line 80
def initialize(time, record)
@time = time
@record = record
end
|
Instance Method Details
#dup ⇒ Object
85
86
87
|
# File 'lib/fluent/event.rb', line 85
def dup
OneEventStream.new(@time, @record.dup)
end
|
#each(unpacker: nil, &block) ⇒ Object
109
110
111
112
|
# File 'lib/fluent/event.rb', line 109
def each(unpacker: nil, &block)
block.call(@time, @record)
nil
end
|
#empty? ⇒ Boolean
89
90
91
|
# File 'lib/fluent/event.rb', line 89
def empty?
false
end
|
#repeatable? ⇒ Boolean
97
98
99
|
# File 'lib/fluent/event.rb', line 97
def repeatable?
true
end
|
#size ⇒ Object
93
94
95
|
# File 'lib/fluent/event.rb', line 93
def size
1
end
|
#slice(index, num) ⇒ Object
101
102
103
104
105
106
107
|
# File 'lib/fluent/event.rb', line 101
def slice(index, num)
if index > 0 || num == 0
ArrayEventStream.new([])
else
self.dup
end
end
|