Class: Twilio::REST::Conversations::V2::ActionPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v2/action.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) ⇒ ActionPageMetadata

Returns a new instance of ActionPageMetadata.



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/twilio-ruby/rest/conversations/v2/action.rb', line 334

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

#action_pageObject (readonly)

Returns the value of attribute action_page.



332
333
334
# File 'lib/twilio-ruby/rest/conversations/v2/action.rb', line 332

def action_page
  @action_page
end

Instance Method Details

#eachObject



350
351
352
353
354
# File 'lib/twilio-ruby/rest/conversations/v2/action.rb', line 350

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

#to_sObject



356
357
358
# File 'lib/twilio-ruby/rest/conversations/v2/action.rb', line 356

def to_s
  '<Twilio::REST::Conversations::V2PageMetadata>';
end