Class: Twilio::REST::Monitor::V1::AlertPageMetadata
- Inherits:
-
PageMetadata
- Object
- PageMetadata
- Twilio::REST::Monitor::V1::AlertPageMetadata
- Defined in:
- lib/twilio-ruby/rest/monitor/v1/alert.rb
Constant Summary
Constants inherited from PageMetadata
Instance Attribute Summary collapse
-
#alert_page ⇒ Object
readonly
Returns the value of attribute alert_page.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(version, response, solution, limit) ⇒ AlertPageMetadata
constructor
A new instance of AlertPageMetadata.
- #to_s ⇒ Object
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) ⇒ AlertPageMetadata
Returns a new instance of AlertPageMetadata.
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 341 def initialize(version, response, solution, limit) super(version, response) @alert_page = [] @limit = limit key = get_key(response.body) records = 0 while( limit != :unset && records < limit ) @alert_page << AlertListResponse.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
#alert_page ⇒ Object (readonly)
Returns the value of attribute alert_page.
339 340 341 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 339 def alert_page @alert_page end |
Instance Method Details
#each ⇒ Object
357 358 359 360 361 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 357 def each @alert_page.each do |record| yield record end end |
#to_s ⇒ Object
363 364 365 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 363 def to_s '<Twilio::REST::Monitor::V1PageMetadata>'; end |