A class for representing BSON Timestamps. The Timestamp type is used by MongoDB internally; thus, it should be used by application developers for diagnostic purposes only.
# File lib/bson/types/timestamp.rb, line 38 def ==(other) self.seconds == other.seconds && self.increment == other.increment end
This is for backward-compatibility. Timestamps in the Ruby driver used to deserialize as arrays. So we provide an equivalent interface.
@deprecated
# File lib/bson/types/timestamp.rb, line 48 def [](index) warn "Timestamps are no longer deserialized as arrays. If you're working " + "with BSON Timestamp objects, see the BSON::Timestamp class. This usage will " + "be deprecated in Ruby Driver v2.0." if index == 0 self.increment elsif index == 1 self.seconds else nil end end
Generated with the Darkfish Rdoc Generator 2.