Class: Twilio::REST::FlexApi::V1::InsightsConversationsPageMetadata

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

Returns a new instance of InsightsConversationsPageMetadata.



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb', line 209

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

#insights_conversations_pageObject (readonly)

Returns the value of attribute insights_conversations_page.



207
208
209
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb', line 207

def insights_conversations_page
  @insights_conversations_page
end

Instance Method Details

#eachObject



225
226
227
228
229
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb', line 225

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

#to_sObject



231
232
233
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb', line 231

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