Module: BSON::LogStashTimestamp

Defined in:
lib/logstash/outputs/bson/logstash_timestamp.rb

Overview

Injects behaviour for encoding and decoding time values to and from raw bytes as specified by the BSON spec.

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

BSON_TYPE =

A time is type 0x09 in the BSON spec.

9.chr.force_encoding(BINARY).freeze

Instance Method Summary collapse

Instance Method Details

#to_bson(encoded = ''.force_encoding(BINARY)) ⇒ Object



28
29
30
# File 'lib/logstash/outputs/bson/logstash_timestamp.rb', line 28

def to_bson(encoded = ''.force_encoding(BINARY))
  time.to_bson(encoded)
end