Sha256: e7d906a2d84ae9eeada944722590aa3be3757fb28e89cc3da825a7572015cfca
Contents?: true
Size: 811 Bytes
Versions: 14
Compression:
Stored size: 811 Bytes
Contents
# frozen_string_literal: true class <%= @index_name %> < <%= @base_class %> module Collections class <%= @repo.camelize if @repo %>Collection < Esse::Collection <%- if @repo -%> # @yield [Array<<%= @repo.camelize %>>] # @see <%= @index_name %>::<%= @repo.camelize %>#collection <%- end -%> def each offset = 0 while (rows = find_all(offset)) break if rows.none? offset += 1 yield(rows) # You may also preload associations here or add metadata useful for the document # yield(rows, **preload_associations(rows)) end end protected # @param offset [Number] Offset to start from def find_all(offset) # @TODO load data from persistent storage end end end end
Version data entries
14 entries across 14 versions & 1 rubygems