Class: Twilio::REST::Notify::V1::ServiceContext::BindingPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/notify/v1/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.



476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/twilio-ruby/rest/notify/v1/service/binding.rb', line 476

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.



474
475
476
# File 'lib/twilio-ruby/rest/notify/v1/service/binding.rb', line 474

def binding_page
  @binding_page
end

Instance Method Details

#eachObject



492
493
494
495
496
# File 'lib/twilio-ruby/rest/notify/v1/service/binding.rb', line 492

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

#to_sObject



498
499
500
# File 'lib/twilio-ruby/rest/notify/v1/service/binding.rb', line 498

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