Class: Mongo::Protocol::Reply::Upconverter
- Inherits:
-
Object
- Object
- Mongo::Protocol::Reply::Upconverter
- Defined in:
- lib/mongo/protocol/reply.rb
Overview
Upconverts legacy replies to new op command replies.
Constant Summary collapse
- NEXT_BATCH =
Next batch constant.
'nextBatch'- FIRST_BATCH =
First batch constant.
'firstBatch'- CURSOR =
Cursor field constant.
'cursor'- ID =
Id field constant.
'id'
Instance Attribute Summary collapse
-
#cursor_id ⇒ Integer
readonly
Cursor_id The cursor id.
-
#documents ⇒ Array<BSON::Document>
readonly
Documents The documents.
-
#starting_from ⇒ Integer
readonly
Starting_from The starting point in the cursor.
Instance Method Summary collapse
-
#command ⇒ BSON::Document
Get the upconverted command.
-
#initialize(documents, cursor_id, starting_from) ⇒ Upconverter
constructor
Initialize the new upconverter.
Constructor Details
#initialize(documents, cursor_id, starting_from) ⇒ Upconverter
Initialize the new upconverter.
146 147 148 149 150 |
# File 'lib/mongo/protocol/reply.rb', line 146 def initialize(documents, cursor_id, starting_from) @documents = documents @cursor_id = cursor_id @starting_from = starting_from end |
Instance Attribute Details
#cursor_id ⇒ Integer (readonly)
Returns cursor_id The cursor id.
156 157 158 |
# File 'lib/mongo/protocol/reply.rb', line 156 def cursor_id @cursor_id end |
#documents ⇒ Array<BSON::Document> (readonly)
Returns documents The documents.
153 154 155 |
# File 'lib/mongo/protocol/reply.rb', line 153 def documents @documents end |
#starting_from ⇒ Integer (readonly)
Returns starting_from The starting point in the cursor.
159 160 161 |
# File 'lib/mongo/protocol/reply.rb', line 159 def starting_from @starting_from end |
Instance Method Details
#command ⇒ BSON::Document
Get the upconverted command.
169 170 171 |
# File 'lib/mongo/protocol/reply.rb', line 169 def command command? ? op_command : find_command end |