Class: LogStash::Codecs::Fluent::EventTime
- Inherits:
-
Object
- Object
- LogStash::Codecs::Fluent::EventTime
- Defined in:
- lib/logstash/codecs/fluent/event_time.rb
Constant Summary collapse
- TYPE =
0
Instance Attribute Summary collapse
-
#nsec ⇒ Object
readonly
Returns the value of attribute nsec.
-
#sec ⇒ Object
readonly
Returns the value of attribute sec.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(sec, nsec = 0) ⇒ EventTime
constructor
A new instance of EventTime.
- #to_json(*args) ⇒ Object
- #to_msgpack(io = nil) ⇒ Object
- #to_msgpack_ext ⇒ Object
Constructor Details
#initialize(sec, nsec = 0) ⇒ EventTime
Returns a new instance of EventTime.
7 8 9 10 |
# File 'lib/logstash/codecs/fluent/event_time.rb', line 7 def initialize(sec, nsec = 0) @sec = sec @nsec = nsec end |
Instance Attribute Details
#nsec ⇒ Object (readonly)
Returns the value of attribute nsec.
3 4 5 |
# File 'lib/logstash/codecs/fluent/event_time.rb', line 3 def nsec @nsec end |
#sec ⇒ Object (readonly)
Returns the value of attribute sec.
3 4 5 |
# File 'lib/logstash/codecs/fluent/event_time.rb', line 3 def sec @sec end |
Class Method Details
.from_msgpack_ext(data) ⇒ Object
20 21 22 |
# File 'lib/logstash/codecs/fluent/event_time.rb', line 20 def self.from_msgpack_ext(data) new(*data.unpack('NN')) end |
Instance Method Details
#to_json(*args) ⇒ Object
24 25 26 |
# File 'lib/logstash/codecs/fluent/event_time.rb', line 24 def to_json(*args) @sec end |
#to_msgpack(io = nil) ⇒ Object
12 13 14 |
# File 'lib/logstash/codecs/fluent/event_time.rb', line 12 def to_msgpack(io = nil) @sec.to_msgpack(io) end |
#to_msgpack_ext ⇒ Object
16 17 18 |
# File 'lib/logstash/codecs/fluent/event_time.rb', line 16 def to_msgpack_ext [@sec, @nsec].pack('NN') end |