Class: Twilio::REST::Assistants::V1::Knowledge::KnowledgeStatusPageMetadata

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

Returns a new instance of KnowledgeStatusPageMetadata.



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 202

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

#knowledge_status_pageObject (readonly)

Returns the value of attribute knowledge_status_page.



200
201
202
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 200

def knowledge_status_page
  @knowledge_status_page
end

Instance Method Details

#eachObject



218
219
220
221
222
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 218

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

#to_sObject



224
225
226
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 224

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