class Mongo::Cursor::Builder::OpKillCursors

Encapsulates behaviour around generating an OP_KILL_CURSORS specification.

@since 2.2.0

Attributes

cursor[R]

@return [ Cursor ] cursor The cursor.

Public Class Methods

new(cursor) click to toggle source

Create the new builder.

@example Create the builder.

OpKillCursors.new(cursor)

@param [ Cursor ] cursor The cursor.

@since 2.2.0

# File lib/mongo/cursor/builder/op_kill_cursors.rb, line 38
def initialize(cursor)
  @cursor = cursor
end

Public Instance Methods

specification() click to toggle source

Get the specification.

@example Get the specification.

op_kill_cursors.specification

@return [ Hash ] The specification.

@since 2.2.0

# File lib/mongo/cursor/builder/op_kill_cursors.rb, line 50
def specification
  { :coll_name => collection_name, :db_name => database.name, :cursor_ids => [ cursor.id ] }
end