Sha256: e6460ed08f468ab2b36b2168d80e6bcc4c88555d789d93b8850becfb1276bd9e

Contents?: true

Size: 801 Bytes

Versions: 38

Compression:

Stored size: 801 Bytes

Contents

# encoding: utf-8
module Mongoid
  class Criteria
    module Queryable

      # Adds macro behaviour 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.
        #
        # @since 1.0.0
        def key(name, strategy, operator, additional = nil, &block)
          ::Symbol.add_key(name, strategy, operator, additional, &block)
        end
      end
    end
  end
end

Version data entries

38 entries across 36 versions & 2 rubygems

Version Path
mongoid-7.0.13 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.12 lib/mongoid/criteria/queryable/macroable.rb
mongoid-6.4.8 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.11 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.10 lib/mongoid/criteria/queryable/macroable.rb
mongoid-6.4.7 lib/mongoid/criteria/queryable/macroable.rb
mongoid-6.4.5 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.8 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.7 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.6 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.5 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.4 lib/mongoid/criteria/queryable/macroable.rb
mongoid-6.4.4 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.3 lib/mongoid/criteria/queryable/macroable.rb
mongoid-6.4.2 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.2 lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.1 lib/mongoid/criteria/queryable/macroable.rb
mongoid-6.4.1 lib/mongoid/criteria/queryable/macroable.rb
tdiary-5.0.8 vendor/bundle/gems/mongoid-6.4.0/lib/mongoid/criteria/queryable/macroable.rb
mongoid-7.0.0 lib/mongoid/criteria/queryable/macroable.rb