Sha256: dc7810afafa960f83fa8480850a7c82c7b1659eab7fd27a22d2413a10b5a9a7e

Contents?: true

Size: 415 Bytes

Versions: 22

Compression:

Stored size: 415 Bytes

Contents

module Ddr::Index
  class AbstractQueryResult
    include Enumerable

    attr_reader :query, :conn
    delegate :params, to: :query

    def initialize(query)
      @query = query
      @conn = Connection.new
    end

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

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

  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ddr-models-3.0.0.beta.3 lib/ddr/index/abstract_query_result.rb
ddr-models-2.4.0.rc5 lib/ddr/index/abstract_query_result.rb
ddr-models-2.4.0.rc4 lib/ddr/index/abstract_query_result.rb
ddr-models-3.0.0.beta.2 lib/ddr/index/abstract_query_result.rb
ddr-models-2.4.0.rc3 lib/ddr/index/abstract_query_result.rb
ddr-models-2.4.0.rc2 lib/ddr/index/abstract_query_result.rb
ddr-models-2.4.0.rc1 lib/ddr/index/abstract_query_result.rb
ddr-models-2.3.2 lib/ddr/index/abstract_query_result.rb
ddr-models-3.0.0.beta.1 lib/ddr/index/abstract_query_result.rb
ddr-models-2.3.1 lib/ddr/index/abstract_query_result.rb
ddr-models-3.0.0.alpha.4 lib/ddr/index/abstract_query_result.rb
ddr-models-3.0.0.alpha.3 lib/ddr/index/abstract_query_result.rb
ddr-models-2.3.0 lib/ddr/index/abstract_query_result.rb
ddr-models-3.0.0.alpha.2 lib/ddr/index/abstract_query_result.rb
ddr-models-3.0.0.alpha.1 lib/ddr/index/abstract_query_result.rb
ddr-models-2.2.0 lib/ddr/index/abstract_query_result.rb
ddr-models-2.1.3 lib/ddr/index/abstract_query_result.rb
ddr-models-2.1.2 lib/ddr/index/abstract_query_result.rb
ddr-models-2.1.1 lib/ddr/index/abstract_query_result.rb
ddr-models-2.1.0 lib/ddr/index/abstract_query_result.rb