Class: Twilio::REST::Api::V2010::AccountContext::UsageList::RecordPageMetadata
- Inherits:
-
PageMetadata
- Object
- PageMetadata
- Twilio::REST::Api::V2010::AccountContext::UsageList::RecordPageMetadata
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/usage/record.rb
Constant Summary
Constants inherited from PageMetadata
Instance Attribute Summary collapse
-
#record_page ⇒ Object
readonly
Returns the value of attribute record_page.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(version, response, solution, limit) ⇒ RecordPageMetadata
constructor
A new instance of RecordPageMetadata.
- #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) ⇒ RecordPageMetadata
Returns a new instance of RecordPageMetadata.
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 292 def initialize(version, response, solution, limit) super(version, response) @record_page = [] @limit = limit key = get_key(response.body) records = 0 while( limit != :unset && records < limit ) @record_page << RecordListResponse.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
#record_page ⇒ Object (readonly)
Returns the value of attribute record_page.
290 291 292 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 290 def record_page @record_page end |
Instance Method Details
#each ⇒ Object
308 309 310 311 312 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 308 def each @record_page.each do |record| yield record end end |
#to_s ⇒ Object
314 315 316 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 314 def to_s '<Twilio::REST::Api::V2010PageMetadata>'; end |