Class: Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryContext::MobilePageMetadata

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

Returns a new instance of MobilePageMetadata.



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/mobile.rb', line 340

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

#mobile_pageObject (readonly)

Returns the value of attribute mobile_page.



338
339
340
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/mobile.rb', line 338

def mobile_page
  @mobile_page
end

Instance Method Details

#eachObject



356
357
358
359
360
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/mobile.rb', line 356

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

#to_sObject



362
363
364
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/mobile.rb', line 362

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