Class: Twilio::REST::Intelligence::V3::OperatorResultPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/intelligence/v3/operator_result.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) ⇒ OperatorResultPageMetadata

Returns a new instance of OperatorResultPageMetadata.



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 385

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

#operator_result_pageObject (readonly)

Returns the value of attribute operator_result_page.



383
384
385
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 383

def operator_result_page
  @operator_result_page
end

Instance Method Details

#eachObject



401
402
403
404
405
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 401

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

#to_sObject



407
408
409
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 407

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