Sha256: 8e28a1180dd131fed1c383793e33c4f685cc1d98615a861ab4e50615f5197b62

Contents?: true

Size: 664 Bytes

Versions: 27

Compression:

Stored size: 664 Bytes

Contents

# frozen_string_literal: true

module Mongoid
  module Errors

    # Raised when invalid expression-level operator is passed to an
    # embedded matcher.
    class InvalidExpressionOperator < InvalidQuery

      # Creates the exception.
      #
      # @param [ String ] operator The operator that was used.
      #
      # @api private
      def initialize(operator)
        @operator = operator
        super(compose_message("invalid_expression_operator",
          operator: operator,
          valid_operators: "'$and', '$nor', '$or'",
        ))
      end

      # @return [ String ] The operator that was used.
      attr_reader :operator
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
mongoid-8.1.9 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.0.9 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.1.8 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.1.7 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.1.6 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.0.8 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.1.5 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.1.4 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.0.7 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.1.3 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.1.2 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.0.6 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-7.5.4 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.1.1 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.0.5 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.1.0 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-7.5.3 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.0.4 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-8.0.3 lib/mongoid/errors/invalid_expression_operator.rb
mongoid-7.5.2 lib/mongoid/errors/invalid_expression_operator.rb