Class: Mongo::Cursor::KillSpec Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo/cursor/kill_spec.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This class contains the operation specification for KillCursors.

Its purpose is to ensure we don’t misspell attribute names accidentally.

API:

  • private

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cursor_id:, coll_name:, db_name:, service_id:, server_address:) ⇒ KillSpec

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of KillSpec.

API:

  • private



28
29
30
31
32
33
34
# File 'lib/mongo/cursor/kill_spec.rb', line 28

def initialize(cursor_id:, coll_name:, db_name:, service_id:, server_address:)
  @cursor_id = cursor_id
  @coll_name = coll_name
  @db_name = db_name
  @service_id = service_id
  @server_address = server_address
end

Instance Attribute Details

#coll_nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



36
37
38
# File 'lib/mongo/cursor/kill_spec.rb', line 36

def coll_name
  @coll_name
end

#cursor_idObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



36
37
38
# File 'lib/mongo/cursor/kill_spec.rb', line 36

def cursor_id
  @cursor_id
end

#db_nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



36
37
38
# File 'lib/mongo/cursor/kill_spec.rb', line 36

def db_name
  @db_name
end

#server_addressObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



36
37
38
# File 'lib/mongo/cursor/kill_spec.rb', line 36

def server_address
  @server_address
end

#service_idObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



36
37
38
# File 'lib/mongo/cursor/kill_spec.rb', line 36

def service_id
  @service_id
end

Instance Method Details

#==(other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



38
39
40
41
42
43
44
# File 'lib/mongo/cursor/kill_spec.rb', line 38

def ==(other)
  cursor_id == other.cursor_id &&
    coll_name == other.coll_name &&
    db_name == other.db_name &&
    service_id == other.service_id &&
    server_address == other.server_address
end

#eql?(other) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

API:

  • private



46
47
48
# File 'lib/mongo/cursor/kill_spec.rb', line 46

def eql?(other)
  self.==(other)
end

#hashObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



50
51
52
# File 'lib/mongo/cursor/kill_spec.rb', line 50

def hash
  [cursor_id, coll_name, db_name, service_id, server_address].compact.hash
end