Class: Twilio::REST::Chat::V3::ChannelPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/chat/v3/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) ⇒ ChannelPageMetadata

Returns a new instance of ChannelPageMetadata.



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/twilio-ruby/rest/chat/v3/channel.rb', line 227

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

#channel_pageObject (readonly)

Returns the value of attribute channel_page.



225
226
227
# File 'lib/twilio-ruby/rest/chat/v3/channel.rb', line 225

def channel_page
  @channel_page
end

Instance Method Details

#eachObject



243
244
245
246
247
# File 'lib/twilio-ruby/rest/chat/v3/channel.rb', line 243

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

#to_sObject



249
250
251
# File 'lib/twilio-ruby/rest/chat/v3/channel.rb', line 249

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