Class: Twilio::REST::Accounts::V1::CredentialPageMetadata

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

Returns a new instance of CredentialPageMetadata.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/twilio-ruby/rest/accounts/v1/credential.rb', line 104

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

#credential_pageObject (readonly)

Returns the value of attribute credential_page.



102
103
104
# File 'lib/twilio-ruby/rest/accounts/v1/credential.rb', line 102

def credential_page
  @credential_page
end

Instance Method Details

#eachObject



120
121
122
123
124
# File 'lib/twilio-ruby/rest/accounts/v1/credential.rb', line 120

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

#to_sObject



126
127
128
# File 'lib/twilio-ruby/rest/accounts/v1/credential.rb', line 126

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