Sha256: 488dabc97bf3ac8b7eee5bd166c8e93de37490ea18cb51bf71efb7b020fec595

Contents?: true

Size: 494 Bytes

Versions: 1

Compression:

Stored size: 494 Bytes

Contents

module Indices
  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] = Indices[args.first].search(options).query[:query]
        else
          super
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
indices-0.0.1 lib/indices/dsl/search.rb