module AWS::S3::PaginatedCollection

@private

Protected Instance Methods

_each_item(markers, limit, options = {}) click to toggle source
# File lib/aws/s3/paginated_collection.rb, line 23
def _each_item markers, limit, options = {}, &block

  options = list_options(options)
  options.merge!(markers) unless markers.nil? or markers.empty?
  options[limit_param] = limit || 1000

  response = list_request(options)

  each_member_in_page(response, &block)

  response.truncated? ? next_markers(response) : nil

end
each_member_in_page(page, &block) click to toggle source
# File lib/aws/s3/paginated_collection.rb, line 38
def each_member_in_page(page, &block); end
limit_param() click to toggle source
# File lib/aws/s3/paginated_collection.rb, line 53
def limit_param
  raise NotImplementedError
end
list_options(options) click to toggle source
# File lib/aws/s3/paginated_collection.rb, line 46
def list_options options
  opts = {}
  opts[:bucket_name] = bucket.name if respond_to?(:bucket)
  opts
end
list_request(options) click to toggle source
# File lib/aws/s3/paginated_collection.rb, line 41
def list_request(options)
  raise NotImplementedError
end
next_markers(page) click to toggle source
# File lib/aws/s3/paginated_collection.rb, line 63
def next_markers page
  pagination_markers.inject({}) do |markers, marker_name|
    if marker = page.send("next_#{marker_name}")
      markers[marker_name] = marker if marker
    end
    markers
  end
end
pagination_markers() click to toggle source
# File lib/aws/s3/paginated_collection.rb, line 58
def pagination_markers
  [:key_marker]
end