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

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

Returns a new instance of MachineToMachinePageMetadata.



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/machine_to_machine.rb', line 332

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

#machine_to_machine_pageObject (readonly)

Returns the value of attribute machine_to_machine_page.



330
331
332
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/machine_to_machine.rb', line 330

def machine_to_machine_page
  @machine_to_machine_page
end

Instance Method Details

#eachObject



348
349
350
351
352
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/machine_to_machine.rb', line 348

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

#to_sObject



354
355
356
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/machine_to_machine.rb', line 354

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