Class: Twilio::REST::Chat::V1::ServiceContext::UserContext::UserChannelPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/chat/v1/service/user/user_channel.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) ⇒ UserChannelPageMetadata

Returns a new instance of UserChannelPageMetadata.



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 196

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

#user_channel_pageObject (readonly)

Returns the value of attribute user_channel_page.



194
195
196
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 194

def user_channel_page
  @user_channel_page
end

Instance Method Details

#eachObject



212
213
214
215
216
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 212

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

#to_sObject



218
219
220
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 218

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