Class: Twilio::REST::Lookups::V1::PhoneNumberPageMetadata

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



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 230

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.



228
229
230
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 228

def phone_number_page
  @phone_number_page
end

Instance Method Details

#eachObject



246
247
248
249
250
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 246

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

#to_sObject



252
253
254
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 252

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