Sha256: 9606454b27cd8ff5b19d45d7bc48dc2a891a9ba3db0f92876d44468249d71ff7

Contents?: true

Size: 780 Bytes

Versions: 24

Compression:

Stored size: 780 Bytes

Contents

# frozen_string_literal: true

module Mongoid
  class Criteria
    module Queryable

      # Adds macro behavior for adding symbol methods.
      module Macroable

        # Adds a method on Symbol for convenience in where queries for the
        # provided operators.
        #
        # @example Add a symbol key.
        #   key :all, "$all
        #
        # @param [ Symbol ] name The name of the method.
        # @param [ Symbol ] strategy The merge strategy.
        # @param [ String ] operator The MongoDB operator.
        # @param [ String ] additional The additional MongoDB operator.
        def key(name, strategy, operator, additional = nil, &block)
          ::Symbol.add_key(name, strategy, operator, additional, &block)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
mongoid-8.1.7 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.1.6 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.0.8 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.1.5 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.1.4 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.0.7 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.1.3 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.1.2 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.0.6 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.5.4 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.1.1 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.0.5 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.1.0 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.5.3 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.0.4 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.0.3 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.5.2 lib/mongoid/criteria/queryable/macroable.rb
mongoid-8.0.2 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.5.1 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.4.3 lib/mongoid/criteria/queryable/macroable.rb