Class: Twilio::REST::Assistants::V1::AssistantContext::MessagePageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/assistants/v1/assistant/message.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) ⇒ MessagePageMetadata

Returns a new instance of MessagePageMetadata.



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 152

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

#message_pageObject (readonly)

Returns the value of attribute message_page.



150
151
152
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 150

def message_page
  @message_page
end

Instance Method Details

#eachObject



168
169
170
171
172
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 168

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

#to_sObject



174
175
176
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 174

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