Class: Moped::BSON::Timestamp

Inherits:
Struct
  • Object
show all
Defined in:
lib/moped/bson/timestamp.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#incrementObject

Returns the value of attribute increment

Returns:

  • (Object)

    the current value of increment



3
4
5
# File 'lib/moped/bson/timestamp.rb', line 3

def increment
  @increment
end

#secondsObject

Returns the value of attribute seconds

Returns:

  • (Object)

    the current value of seconds



3
4
5
# File 'lib/moped/bson/timestamp.rb', line 3

def seconds
  @seconds
end

Class Method Details

.__bson_load__(io) ⇒ Object



5
6
7
# File 'lib/moped/bson/timestamp.rb', line 5

def __bson_load__(io)
  new(*io.read(8).unpack('l2').reverse)
end

Instance Method Details

#__bson_dump__(io, key) ⇒ Object



10
11
12
# File 'lib/moped/bson/timestamp.rb', line 10

def __bson_dump__(io, key)
  io << [17, key, increment, seconds].pack('cZ*l2')
end