Exception: BSON::Error::InvalidKey

Inherits:
BSON::Error
  • Object
show all
Defined in:
lib/bson/error/invalid_key.rb

Overview

Raised when trying to serialize an object into a key.

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ InvalidKey

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.

Instantiate the exception.

Examples:

Instantiate the exception.

BSON::Object::InvalidKey.new(object)

Parameters:

  • object (Object)

    The object that was meant for the key.



18
19
20
# File 'lib/bson/error/invalid_key.rb', line 18

def initialize(object)
  super("#{object.class} instances are not allowed as keys in a BSON document.")
end