Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::BundleContext::ItemAssignmentPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.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) ⇒ ItemAssignmentPageMetadata

Returns a new instance of ItemAssignmentPageMetadata.



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 413

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

#item_assignment_pageObject (readonly)

Returns the value of attribute item_assignment_page.



411
412
413
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 411

def item_assignment_page
  @item_assignment_page
end

Instance Method Details

#eachObject



429
430
431
432
433
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 429

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

#to_sObject



435
436
437
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 435

def to_s
  '<Twilio::REST::Numbers::V2PageMetadata>';
end