Sha256: 051b3281769acc5c2e818a47930d2cb5117d4b11e4cb0a893f980e1ebf5eb129

Contents?: true

Size: 555 Bytes

Versions: 6

Compression:

Stored size: 555 Bytes

Contents

# frozen_string_literal: true
# rubocop:todo all

module BSON
  class Error

    # Raised when trying to serialize an object into a key.
    class InvalidKey < Error

      # Instantiate the exception.
      #
      # @example Instantiate the exception.
      #   BSON::Object::InvalidKey.new(object)
      #
      # @param [ Object ] object The object that was meant for the key.
      #
      # @api private
      def initialize(object)
        super("#{object.class} instances are not allowed as keys in a BSON document.")
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bson-5.0.2 lib/bson/error/invalid_key.rb
bson-5.0.2-java lib/bson/error/invalid_key.rb
bson-5.0.1 lib/bson/error/invalid_key.rb
bson-5.0.1-java lib/bson/error/invalid_key.rb
bson-5.0.0-java lib/bson/error/invalid_key.rb
bson-5.0.0 lib/bson/error/invalid_key.rb