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.



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb', line 537

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.



535
536
537
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb', line 535

def trigger_page
  @trigger_page
end

Instance Method Details

#eachObject



553
554
555
556
557
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb', line 553

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

#to_sObject



559
560
561
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb', line 559

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