Class: Mongo::TopologyVersion Private
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
BSON::Document
|
|
Instance Chain:
self,
BSON::Document
|
|
Inherits: |
BSON::Document
|
Defined in: | lib/mongo/topology_version.rb |
Overview
TopologyVersion
encapsulates the topologyVersion document obtained from hello responses and not master-like OperationFailure errors.
Class Method Summary
- .new(doc) ⇒ TopologyVersion constructor Internal use only
Instance Method Summary
- #counter ⇒ Integer Internal use only
-
#gt?(other) ⇒ true | false
Internal use only
Returns whether this topology version is potentially newer than another topology version.
-
#gte?(other) ⇒ true | false
Internal use only
Returns whether this topology version is potentially newer than or equal to another topology version.
- #process_id ⇒ BSON::ObjectId Internal use only
-
#to_doc ⇒ BSON::Document
Internal use only
Converts the object to a document suitable for being sent to the server.
Instance Method Details
#counter ⇒ Integer
# File 'lib/mongo/topology_version.rb', line 43
def counter self['counter'] end
#gt?(other) ⇒ true
| false
Returns whether this topology version is potentially newer than another topology version.
Note that there is no total ordering of topology versions - given two topology versions, each may be “potentially newer” than the other one.
# File 'lib/mongo/topology_version.rb', line 57
def gt?(other) if process_id != other.process_id true else counter > other.counter end end
#gte?(other) ⇒ true
| false
Returns whether this topology version is potentially newer than or equal to another topology version.
Note that there is no total ordering of topology versions - given two topology versions, each may be “potentially newer” than the other one.
# File 'lib/mongo/topology_version.rb', line 75
def gte?(other) if process_id != other.process_id true else counter >= other.counter end end
#process_id ⇒ BSON::ObjectId
# File 'lib/mongo/topology_version.rb', line 38
def process_id self['processId'] end
#to_doc ⇒ BSON::Document
Converts the object to a document suitable for being sent to the server.