Class: Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberPageMetadata

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

Returns a new instance of IncomingPhoneNumberPageMetadata.



810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 810

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

#incoming_phone_number_pageObject (readonly)

Returns the value of attribute incoming_phone_number_page.



808
809
810
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 808

def incoming_phone_number_page
  @incoming_phone_number_page
end

Instance Method Details

#eachObject



826
827
828
829
830
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 826

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

#to_sObject



832
833
834
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 832

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