Sha256: 8c2df389ce1cc816fba5bde7e59297b5d352c0677d36187da2738f6e2584191f

Contents?: true

Size: 396 Bytes

Versions: 79

Compression:

Stored size: 396 Bytes

Contents

module Ddr::Index
  class AbstractQueryResult
    include Enumerable

    attr_reader :query
    delegate :params, to: :query

    def initialize(query)
      @query = query.dup.freeze
    end

    def count
      response = Connection.select(params, rows: 0)
      response.num_found
    end

    def each
      raise NotImplementedError, "Subclasses must implement `#each`."
    end

  end
end

Version data entries

79 entries across 79 versions & 2 rubygems

Version Path
ddr-core-1.17.0 lib/ddr/index/abstract_query_result.rb
ddr-core-1.16.0 lib/ddr/index/abstract_query_result.rb
ddr-core-1.15.0 lib/ddr/index/abstract_query_result.rb
ddr-core-1.14.0 lib/ddr/index/abstract_query_result.rb
ddr-core-1.13.2 lib/ddr/index/abstract_query_result.rb
ddr-core-1.13.1 lib/ddr/index/abstract_query_result.rb
ddr-core-1.13.0 lib/ddr/index/abstract_query_result.rb
ddr-core-1.12.2 lib/ddr/index/abstract_query_result.rb
ddr-core-1.12.1 lib/ddr/index/abstract_query_result.rb
ddr-core-1.12.0 lib/ddr/index/abstract_query_result.rb
ddr-core-1.11.0 lib/ddr/index/abstract_query_result.rb
ddr-core-1.10.0 lib/ddr/index/abstract_query_result.rb
ddr-core-1.9.0 lib/ddr/index/abstract_query_result.rb
ddr-core-1.8.0 lib/ddr/index/abstract_query_result.rb
ddr-core-1.7.0 lib/ddr/index/abstract_query_result.rb
ddr-core-1.6.6 lib/ddr/index/abstract_query_result.rb
ddr-core-1.6.5 lib/ddr/index/abstract_query_result.rb
ddr-core-1.6.4 lib/ddr/index/abstract_query_result.rb
ddr-core-1.6.3 lib/ddr/index/abstract_query_result.rb
ddr-core-1.6.2 lib/ddr/index/abstract_query_result.rb