Class: Twilio::REST::Memory::V1::ProfilePageMetadata

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

Returns a new instance of ProfilePageMetadata.



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 537

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

#profile_pageObject (readonly)

Returns the value of attribute profile_page.



535
536
537
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 535

def profile_page
  @profile_page
end

Instance Method Details

#eachObject



553
554
555
556
557
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 553

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

#to_sObject



559
560
561
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 559

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