Class: Twilio::REST::Intelligence::V2::CustomOperatorPageMetadata

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

Returns a new instance of CustomOperatorPageMetadata.



501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 501

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

#custom_operator_pageObject (readonly)

Returns the value of attribute custom_operator_page.



499
500
501
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 499

def custom_operator_page
  @custom_operator_page
end

Instance Method Details

#eachObject



517
518
519
520
521
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 517

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

#to_sObject



523
524
525
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 523

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