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.



470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 470

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.



468
469
470
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 468

def subscribed_event_page
  @subscribed_event_page
end

Instance Method Details

#eachObject



486
487
488
489
490
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 486

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

#to_sObject



492
493
494
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 492

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