Class: Twilio::REST::Lookups::V2::PhoneNumberPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/lookups/v2/phone_number.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) ⇒ PhoneNumberPageMetadata

Returns a new instance of PhoneNumberPageMetadata.



296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 296

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

#phone_number_pageObject (readonly)

Returns the value of attribute phone_number_page.



294
295
296
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 294

def phone_number_page
  @phone_number_page
end

Instance Method Details

#eachObject



312
313
314
315
316
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 312

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

#to_sObject



318
319
320
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 318

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