Class: Mongo::Protocol::Msg::Section1 Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo/protocol/msg.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.

Encapsulates a type 1 OP_MSG section.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier, documents) ⇒ Section1

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 Section1.

Since:

  • 2.5.0



366
367
368
# File 'lib/mongo/protocol/msg.rb', line 366

def initialize(identifier, documents)
  @identifier, @documents = identifier, documents
end

Instance Attribute Details

#documentsObject (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.

Since:

  • 2.5.0



370
371
372
# File 'lib/mongo/protocol/msg.rb', line 370

def documents
  @documents
end

#identifierObject (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.

Since:

  • 2.5.0



370
371
372
# File 'lib/mongo/protocol/msg.rb', line 370

def identifier
  @identifier
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

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.

Since:

  • 2.5.0



372
373
374
375
# File 'lib/mongo/protocol/msg.rb', line 372

def ==(other)
  other.is_a?(Section1) &&
    identifier == other.identifier && documents == other.documents
end