Anthropic::AutoPaginator(T)
Inherits Enumerable < Reference < Object
Auto-paginating iterator for cursor-based list endpoints. Takes a fetcher proc that retrieves a single page and iterates across all pages automatically using after_id cursor tokens.
Example:
paginator = client.files.list_all(limit: 20)
paginator.each do |file|
puts file.filename
end
Constructors
Creates a new auto-paginator with the given fetcher proc. The fetcher should accept ListParams and return a Page(T).
Instance methods
each
Iterates over all items across all pages. Fetches pages lazily using after_id cursor until has_more? is false.