class Twilio::REST::Version::RecordStream

Public Class Methods

new(page, limit: nil, page_limit: nil) click to toggle source
   # File lib/twilio-ruby/framework/rest/version.rb
11 def initialize(page, limit: nil, page_limit: nil)
12   @page = page
13   @limit = limit
14   @page_limit = page_limit
15 end

Public Instance Methods

each() { |record| ... } click to toggle source
   # File lib/twilio-ruby/framework/rest/version.rb
17 def each
18   current_record = 0
19   current_page = 1
20 
21   while @page
22     @page.each do |record|
23       yield record
24       current_record += 1
25       return nil if @limit && @limit <= current_record
26     end
27 
28     return nil if @page_limit && @page_limit <= current_page
29 
30     @page = @page.next_page
31     current_page += 1
32   end
33 end