Class: Twilio::REST::Sync::V1::ServiceContext::SyncListPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/sync/v1/service/sync_list.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) ⇒ SyncListPageMetadata

Returns a new instance of SyncListPageMetadata.



522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list.rb', line 522

def initialize(version, response, solution, limit)
    super(version, response)
    @sync_list_page = []
    @limit = limit
    key = get_key(response.body)
    records = 0
    while( limit != :unset && records < limit )
        @sync_list_page << SyncListListResponse.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

#sync_list_pageObject (readonly)

Returns the value of attribute sync_list_page.



520
521
522
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list.rb', line 520

def sync_list_page
  @sync_list_page
end

Instance Method Details

#eachObject



538
539
540
541
542
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list.rb', line 538

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

#to_sObject



544
545
546
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list.rb', line 544

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