Class: Mongo::Cursor::Builder::OpKillCursors

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/mongo/cursor/builder/op_kill_cursors.rb

Overview

Encapsulates behaviour around generating an OP_KILL_CURSORS specification.

Since:

  • 2.2.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cursor) ⇒ OpKillCursors

Create the new builder.

Examples:

Create the builder.

OpKillCursors.new(cursor)

Parameters:

  • cursor (Cursor)

    The cursor.

Since:

  • 2.2.0



38
39
40
# File 'lib/mongo/cursor/builder/op_kill_cursors.rb', line 38

def initialize(cursor)
  @cursor = cursor
end

Instance Attribute Details

#cursorCursor (readonly)

Returns cursor The cursor.

Returns:

  • (Cursor)

    cursor The cursor.

Since:

  • 2.2.0



26
27
28
# File 'lib/mongo/cursor/builder/op_kill_cursors.rb', line 26

def cursor
  @cursor
end

Instance Method Details

#specificationHash

Get the specification.

Examples:

Get the specification.

op_kill_cursors.specification

Returns:

  • (Hash)

    The specification.

Since:

  • 2.2.0



50
51
52
# 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