Injects behaviour for encoding and decoding time values to and from raw bytes as specified by the BSON spec.
@see bsonspec.org/#/specification
@since 2.0.0
Get the time as encoded BSON.
@example Get the time as encoded BSON.
Time.new(2012, 1, 1, 0, 0, 0).to_bson
@return [ String ] The encoded string.
@see bsonspec.org/#/specification
@since 2.0.0
# File lib/bson/time.rb, line 40 def to_bson(encoded = ''.force_encoding(BINARY)) encoded << [ (to_f * 1000.0).to_i ].pack(Int64::PACK) end
Generated with the Darkfish Rdoc Generator 2.