Class: Twilio::REST::Events::V1::SubscriptionContext::SubscribedEventPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.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) ⇒ SubscribedEventPageMetadata

Returns a new instance of SubscribedEventPageMetadata.



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 478

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

#subscribed_event_pageObject (readonly)

Returns the value of attribute subscribed_event_page.



476
477
478
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 476

def subscribed_event_page
  @subscribed_event_page
end

Instance Method Details

#eachObject



494
495
496
497
498
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 494

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

#to_sObject



500
501
502
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 500

def to_s
  '<Twilio::REST::Events::V1PageMetadata>';
end