Class: Twilio::REST::Routes::V2::PhoneNumberPageMetadata
- Inherits:
-
PageMetadata
- Object
- PageMetadata
- Twilio::REST::Routes::V2::PhoneNumberPageMetadata
- Defined in:
- lib/twilio-ruby/rest/routes/v2/phone_number.rb
Constant Summary
Constants inherited from PageMetadata
Instance Attribute Summary collapse
-
#phone_number_page ⇒ Object
readonly
Returns the value of attribute phone_number_page.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(version, response, solution, limit) ⇒ PhoneNumberPageMetadata
constructor
A new instance of PhoneNumberPageMetadata.
- #to_s ⇒ Object
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.
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 264 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_page ⇒ Object (readonly)
Returns the value of attribute phone_number_page.
262 263 264 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 262 def phone_number_page @phone_number_page end |
Instance Method Details
#each ⇒ Object
280 281 282 283 284 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 280 def each @phone_number_page.each do |record| yield record end end |
#to_s ⇒ Object
286 287 288 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 286 def to_s '<Twilio::REST::Routes::V2PageMetadata>'; end |