Method: Orchestrate::RefList::Fetcher#each
- Defined in:
- lib/orchestrate/refs.rb
#each ⇒ Object #each {|ref| ... } ⇒ Object
Iterates over each Ref for the KeyValue. Used as the basis for Enumerable. Refs are provided in time-series order, newest to oldest.
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/orchestrate/refs.rb', line 120 def each params = {limit: limit} params[:offset] = offset if offset params[:values] = true if values @response ||= key_value.perform(:list_refs, params) return enum_for(:each) unless block_given? raise ResultsNotReady.new if key_value.collection.app.inside_parallel? loop do @response.results.each do |doc| yield Ref.from_listing(key_value.collection, doc, @response) end break unless @response.next_link @response = @response.next_results end @response = nil end |