Module: Mongoid::Matcher::ExpressionOperator Private

Defined in:
lib/mongoid/matcher/expression_operator.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Singleton module provides lookup of logical query operator matchers.

Constant Summary collapse

MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  '$and' => And,
  '$nor' => Nor,
  '$or' => Or,
}.freeze

Class Method Summary collapse

Class Method Details

.get(op) ⇒ Module

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.

Returns the matcher module for a given operator.

Parameters:

  • op (String)

    The operator name.

Returns:

  • (Module)

    The matcher module.



26
27
28
29
30
# File 'lib/mongoid/matcher/expression_operator.rb', line 26

module_function def get(op)
  MAP.fetch(op)
rescue KeyError
  raise Errors::InvalidExpressionOperator.new(op)
end