Class: Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::ParticipantPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.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) ⇒ ParticipantPageMetadata

Returns a new instance of ParticipantPageMetadata.



576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 576

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

#participant_pageObject (readonly)

Returns the value of attribute participant_page.



574
575
576
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 574

def participant_page
  @participant_page
end

Instance Method Details

#eachObject



592
593
594
595
596
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 592

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

#to_sObject



598
599
600
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 598

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