class Fog::PagedCollection

Base class for collection classes whose 'all' method returns only a single page of results and passes the 'Marker' option along as self.filters

Public Instance Methods

each(filters=filters) { |item| ... } click to toggle source
# File lib/fog/core/collection.rb, line 150
def each(filters=filters)
  if block_given?
    begin
      page = self.all(filters)
      # We need to explicitly use the base 'each' method here on the page, otherwise we get infinite recursion
      base_each = Fog::Collection.instance_method(:each)
      base_each.bind(page).call { |item| yield item }
    end while self.filters[:marker]
  end
  self
end