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(collection_filters = filters) { |item| ... } click to toggle source
# File lib/fog/core/collection.rb, line 119
def each(collection_filters = filters)
  if block_given?
    Kernel.loop do
      break unless filters[:marker]
      page = all(collection_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
  end
  self
end