Class: Twilio::REST::Accounts::V1::CredentialList::PublicKeyPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/accounts/v1/credential/public_key.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) ⇒ PublicKeyPageMetadata

Returns a new instance of PublicKeyPageMetadata.



477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# File 'lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb', line 477

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

#public_key_pageObject (readonly)

Returns the value of attribute public_key_page.



475
476
477
# File 'lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb', line 475

def public_key_page
  @public_key_page
end

Instance Method Details

#eachObject



493
494
495
496
497
# File 'lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb', line 493

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

#to_sObject



499
500
501
# File 'lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb', line 499

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