Class: Twilio::REST::Chat::V2::ServiceContext::BindingPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/chat/v2/service/binding.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) ⇒ BindingPageMetadata

Returns a new instance of BindingPageMetadata.



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/twilio-ruby/rest/chat/v2/service/binding.rb', line 366

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

#binding_pageObject (readonly)

Returns the value of attribute binding_page.



364
365
366
# File 'lib/twilio-ruby/rest/chat/v2/service/binding.rb', line 364

def binding_page
  @binding_page
end

Instance Method Details

#eachObject



382
383
384
385
386
# File 'lib/twilio-ruby/rest/chat/v2/service/binding.rb', line 382

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

#to_sObject



388
389
390
# File 'lib/twilio-ruby/rest/chat/v2/service/binding.rb', line 388

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