Module Mongo::Protocol::Registry
In: lib/mongo/protocol/registry.rb

Provides a registry for looking up a message class based on op code.

@since 2.5.0

Methods

get   register  

Constants

MAPPINGS = {}   A Mapping of all the op codes to their corresponding Ruby classes.

@since 2.5.0

Public Instance methods

Get the class for the given op code and raise an error if it‘s not found.

@example Get the type for the op code.

  Mongo::Protocol::Registry.get(1)

@return [ Class ] The corresponding Ruby class for the message type.

@since 2.5.0

Register the Ruby type for the corresponding op code.

@example Register the op code.

  Mongo::Protocol::Registry.register(1, Reply)

@param [ Fixnum ] op_code The op code. @param [ Class ] type The class the op code maps to.

@return [ Class ] The class.

@since 2.5.0

[Validate]