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