class Azure::Storage::Common::Core::TokenCredential

Public Class Methods

new(token) click to toggle source

Public: Initializes an instance of [Azure::Storage::Common::Core::TokenCredential]

Attributes

  • token - String. The initial access token.

# File lib/azure/storage/common/core/token_credential.rb, line 37
def initialize(token)
  @token = token
  @mutex = Mutex.new
end

Public Instance Methods

renew_token(new_token) click to toggle source

Public: Renews the access token

Attributes

  • new_token - String. The new access token.

# File lib/azure/storage/common/core/token_credential.rb, line 58
def renew_token(new_token)
  @mutex.synchronize do
    @token = new_token
  end
end
token() click to toggle source

Public: Gets the access token

Note: Providing this getter under the protect of a mutex

# File lib/azure/storage/common/core/token_credential.rb, line 46
def token
  @mutex.synchronize do
    @token
  end
end