Sha256: 1b58be9e0a79baf7ba7c0ae12b6c1c2ab092d6153165755f98e3597014a19a94

Contents?: true

Size: 494 Bytes

Versions: 2

Compression:

Stored size: 494 Bytes

Contents

module Indexes
  module Dsl
    class Search < Api

      private

      def add_block(name, args, options)
        if %i(functions must must_not should).include?(name)
          @parent[name] = []
        else
          super
        end
      end

      def add_argument(name, args, options)
        if name == :query && args.first.is_a?(Symbol)
          @parent[name] = Indexes[args.first].search(options).query[:query]
        else
          super
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
indexes-4.0.0.0 lib/indexes/dsl/search.rb
indexes-0.0.1 lib/indexes/dsl/search.rb