Class: Twilio::REST::Memory::V1::IdentifierPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/memory/v1/identifier.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) ⇒ IdentifierPageMetadata

Returns a new instance of IdentifierPageMetadata.



547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 547

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

#identifier_pageObject (readonly)

Returns the value of attribute identifier_page.



545
546
547
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 545

def identifier_page
  @identifier_page
end

Instance Method Details

#eachObject



563
564
565
566
567
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 563

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

#to_sObject



569
570
571
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 569

def to_s
  '<Twilio::REST::Memory::V1PageMetadata>';
end