Exception: BSON::InvalidKey

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/bson/object.rb

Overview

Raised when trying to serialize an object into a key.

Since:

  • 2.2.4

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ InvalidKey

Instantiate the exception.

Examples:

Instantiate the exception.

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

Parameters:

  • object (Object)

    The object that was meant for the key.

Since:

  • 2.2.4



76
77
78
# File 'lib/bson/object.rb', line 76

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