Class: Twilio::REST::Api::V2010::AccountContext::UsageList::TriggerPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/usage/trigger.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) ⇒ TriggerPageMetadata

Returns a new instance of TriggerPageMetadata.



545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb', line 545

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

#trigger_pageObject (readonly)

Returns the value of attribute trigger_page.



543
544
545
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb', line 543

def trigger_page
  @trigger_page
end

Instance Method Details

#eachObject



561
562
563
564
565
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb', line 561

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

#to_sObject



567
568
569
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb', line 567

def to_s
  '<Twilio::REST::Api::V2010PageMetadata>';
end