Class: Twilio::REST::Sync::V1::ServiceContext::SyncListContext::SyncListItemPageMetadata
- Inherits:
-
PageMetadata
- Object
- PageMetadata
- Twilio::REST::Sync::V1::ServiceContext::SyncListContext::SyncListItemPageMetadata
- Defined in:
- lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb
Constant Summary
Constants inherited from PageMetadata
Instance Attribute Summary collapse
-
#sync_list_item_page ⇒ Object
readonly
Returns the value of attribute sync_list_item_page.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(version, response, solution, limit) ⇒ SyncListItemPageMetadata
constructor
A new instance of SyncListItemPageMetadata.
- #to_s ⇒ Object
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) ⇒ SyncListItemPageMetadata
Returns a new instance of SyncListItemPageMetadata.
550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb', line 550 def initialize(version, response, solution, limit) super(version, response) @sync_list_item_page = [] @limit = limit key = get_key(response.body) records = 0 while( limit != :unset && records < limit ) @sync_list_item_page << SyncListItemListResponse.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_item_page ⇒ Object (readonly)
Returns the value of attribute sync_list_item_page.
548 549 550 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb', line 548 def sync_list_item_page @sync_list_item_page end |
Instance Method Details
#each ⇒ Object
566 567 568 569 570 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb', line 566 def each @sync_list_item_page.each do |record| yield record end end |
#to_s ⇒ Object
572 573 574 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb', line 572 def to_s '<Twilio::REST::Sync::V1PageMetadata>'; end |