Class: Fluent::Logger::EventTime

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/logger/fluent_logger.rb

Constant Summary collapse

TYPE =
0

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sec, nsec = 0) ⇒ EventTime

Returns a new instance of EventTime.



29
30
31
32
# File 'lib/fluent/logger/fluent_logger.rb', line 29

def initialize(sec, nsec = 0)
  @sec = sec
  @nsec = nsec
end

Class Method Details

.from_msgpack_ext(data) ⇒ Object



42
43
44
# File 'lib/fluent/logger/fluent_logger.rb', line 42

def self.from_msgpack_ext(data)
  new(*data.unpack('NN'))
end

Instance Method Details

#to_json(*args) ⇒ Object



46
47
48
# File 'lib/fluent/logger/fluent_logger.rb', line 46

def to_json(*args)
  @sec
end

#to_msgpack(io = nil) ⇒ Object



34
35
36
# File 'lib/fluent/logger/fluent_logger.rb', line 34

def to_msgpack(io = nil)
  @sec.to_msgpack(io)
end

#to_msgpack_extObject



38
39
40
# File 'lib/fluent/logger/fluent_logger.rb', line 38

def to_msgpack_ext
  [@sec, @nsec].pack('NN')
end