Class: Twilio::REST::Intelligence::V2::TranscriptContext::SentencePageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.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) ⇒ SentencePageMetadata

Returns a new instance of SentencePageMetadata.



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 211

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

#sentence_pageObject (readonly)

Returns the value of attribute sentence_page.



209
210
211
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 209

def sentence_page
  @sentence_page
end

Instance Method Details

#eachObject



227
228
229
230
231
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 227

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

#to_sObject



233
234
235
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 233

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