Class: Twilio::REST::Supersim::V1::IpCommandPageMetadata

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

Returns a new instance of IpCommandPageMetadata.



435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 435

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

#ip_command_pageObject (readonly)

Returns the value of attribute ip_command_page.



433
434
435
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 433

def ip_command_page
  @ip_command_page
end

Instance Method Details

#eachObject



451
452
453
454
455
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 451

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

#to_sObject



457
458
459
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 457

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