Class: Twilio::REST::Conversations::V2::ConversationPageMetadata

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



1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1064

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.



1062
1063
1064
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1062

def conversation_page
  @conversation_page
end

Instance Method Details

#eachObject



1080
1081
1082
1083
1084
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1080

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

#to_sObject



1086
1087
1088
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1086

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