Class: Twilio::REST::Studio::V1::FlowContext::EngagementContext::EngagementContextPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.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) ⇒ EngagementContextPageMetadata

Returns a new instance of EngagementContextPageMetadata.



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 206

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

#engagement_context_pageObject (readonly)

Returns the value of attribute engagement_context_page.



204
205
206
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 204

def engagement_context_page
  @engagement_context_page
end

Instance Method Details

#eachObject



222
223
224
225
226
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 222

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

#to_sObject



228
229
230
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 228

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