Class: Twilio::REST::Numbers::V2::BundleClonePageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/bundle_clone.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) ⇒ BundleClonePageMetadata

Returns a new instance of BundleClonePageMetadata.



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 226

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

#bundle_clone_pageObject (readonly)

Returns the value of attribute bundle_clone_page.



224
225
226
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 224

def bundle_clone_page
  @bundle_clone_page
end

Instance Method Details

#eachObject



242
243
244
245
246
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 242

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

#to_sObject



248
249
250
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 248

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