Class: Fluent::OneEventStream

Inherits:
EventStream show all
Defined in:
lib/fluent/event.rb

Instance Method Summary collapse

Methods inherited from EventStream

#==, #to_compressed_msgpack_stream, #to_msgpack_stream, #to_msgpack_stream_forced_integer

Methods included from Plugin::Compressable

#compress, #decompress

Constructor Details

#initialize(time, record) ⇒ OneEventStream

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

#dupObject



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

Returns:

  • (Boolean)


89
90
91
# File 'lib/fluent/event.rb', line 89

def empty?
  false
end

#repeatable?Boolean

Returns:

  • (Boolean)


97
98
99
# File 'lib/fluent/event.rb', line 97

def repeatable?
  true
end

#sizeObject



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