Class: Twilio::REST::Conversations::V1::ConversationPageMetadata

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

Returns a new instance of ConversationPageMetadata.



673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 673

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

#conversation_pageObject (readonly)

Returns the value of attribute conversation_page.



671
672
673
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 671

def conversation_page
  @conversation_page
end

Instance Method Details

#eachObject



689
690
691
692
693
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 689

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

#to_sObject



695
696
697
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 695

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