Method: Anthropic::Internal::TokenPage#auto_paging_each
- Defined in:
- lib/anthropic/internal/token_page.rb
#auto_paging_each(&blk) {|| ... } ⇒ void
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/anthropic/internal/token_page.rb', line 48 def auto_paging_each(&blk) unless block_given? raise ArgumentError.new("A block must be given to ##{__method__}") end page = self loop do page.data&.each(&blk) break unless page.next_page? page = page.next_page end end |