Sha256: 08257e9113e178b9a91d5182f5feadab3e79f48c41982fc645599ff02f3845e3

Contents?: true

Size: 466 Bytes

Versions: 1

Compression:

Stored size: 466 Bytes

Contents

module Searchjoy
  module Track
    def search_with_track(term, options = {}, &block)
      results = search_without_track(term, options) do |body|
        block.call(body) if block
      end

      if options[:track]
        attributes = options[:track] == true ? {} : options[:track]
        results.search = Searchjoy::Search.create({search_type: name, query: term, results_count: results.total_count}.merge(attributes))
      end
      results
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
searchjoy-0.0.10 lib/searchjoy/track.rb