Class: Twilio::REST::Preview::HostedNumbers::AuthorizationDocumentContext::DependentHostedNumberOrderPageMetadata

Inherits:
Twilio::REST::PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb

Constant Summary

Constants inherited from Twilio::REST::PageMetadata

Twilio::REST::PageMetadata::META_KEYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Twilio::REST::PageMetadata

#get_key, #next_page, #next_page_url, #previous_page, #previous_page_url, #process_response

Constructor Details

#initialize(version, response, solution, limit) ⇒ DependentHostedNumberOrderPageMetadata

Returns a new instance of DependentHostedNumberOrderPageMetadata.



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb', line 227

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

#dependent_hosted_number_order_pageObject (readonly)

Returns the value of attribute dependent_hosted_number_order_page.



225
226
227
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb', line 225

def dependent_hosted_number_order_page
  @dependent_hosted_number_order_page
end

Instance Method Details

#eachObject



243
244
245
246
247
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb', line 243

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

#to_sObject



249
250
251
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb', line 249

def to_s
  '<Twilio::REST::Preview::HostedNumbersPageMetadata>';
end