Class: Twilio::REST::Api::V2010::AccountContext::OutgoingCallerIdPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.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) ⇒ OutgoingCallerIdPageMetadata

Returns a new instance of OutgoingCallerIdPageMetadata.



422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# File 'lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb', line 422

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

#outgoing_caller_id_pageObject (readonly)

Returns the value of attribute outgoing_caller_id_page.



420
421
422
# File 'lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb', line 420

def outgoing_caller_id_page
  @outgoing_caller_id_page
end

Instance Method Details

#eachObject



438
439
440
441
442
# File 'lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb', line 438

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

#to_sObject



444
445
446
# File 'lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb', line 444

def to_s
  '<Twilio::REST::Api::V2010PageMetadata>';
end