Class: Twilio::REST::Conversations::V1::ServiceContext::UserContext::UserConversationPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v1/service/user/user_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) ⇒ UserConversationPageMetadata

Returns a new instance of UserConversationPageMetadata.



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb', line 424

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

#user_conversation_pageObject (readonly)

Returns the value of attribute user_conversation_page.



422
423
424
# File 'lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb', line 422

def user_conversation_page
  @user_conversation_page
end

Instance Method Details

#eachObject



440
441
442
443
444
# File 'lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb', line 440

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

#to_sObject



446
447
448
# File 'lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb', line 446

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