Method: Mongo::Protocol::Message#maybe_encrypt

Defined in:
lib/mongo/protocol/message.rb

#maybe_encrypt(connection, context) ⇒ Mongo::Protocol::Msg

Possibly encrypt this message with libmongocrypt.

Parameters:

Returns:

  • (Mongo::Protocol::Msg)

    The encrypted message, or the original message if encryption was not possible or necessary.



168
169
170
171
# File 'lib/mongo/protocol/message.rb', line 168

def maybe_encrypt(connection, context)
  # Do nothing if the Message subclass has not implemented this method
  self
end