Class: Twilio::REST::Sync::V1::ServiceContext::DocumentPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/sync/v1/service/document.rb

Constant Summary

Constants inherited from PageMetadata

PageMetadata::META_KEYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PageMetadata

#get_key, #next_page, #next_page_url, #previous_page, #previous_page_url, #process_response

Constructor Details

#initialize(version, response, solution, limit) ⇒ DocumentPageMetadata

Returns a new instance of DocumentPageMetadata.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
# File 'lib/twilio-ruby/rest/sync/v1/service/document.rb', line 506

def initialize(version, response, solution, limit)
    super(version, response)
    @document_page = []
    @limit = limit
    key = get_key(response.body)
    records = 0
    while( limit != :unset && records < limit )
        @document_page << DocumentListResponse.new(version, @payload, key, limit - records)
        @payload = self.next_page
        break unless @payload
        records += @payload.body[key].size
    end
    # Path Solution
    @solution = solution
end

Instance Attribute Details

#document_pageObject (readonly)

Returns the value of attribute document_page.



504
505
506
# File 'lib/twilio-ruby/rest/sync/v1/service/document.rb', line 504

def document_page
  @document_page
end

Instance Method Details

#eachObject



522
523
524
525
526
# File 'lib/twilio-ruby/rest/sync/v1/service/document.rb', line 522

def each
    @document_page.each do |record|
      yield record
    end
end

#to_sObject



528
529
530
# File 'lib/twilio-ruby/rest/sync/v1/service/document.rb', line 528

def to_s
  '<Twilio::REST::Sync::V1PageMetadata>';
end