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.



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 493

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.



491
492
493
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 491

def custom_operator_page
  @custom_operator_page
end

Instance Method Details

#eachObject



509
510
511
512
513
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 509

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

#to_sObject



515
516
517
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 515

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