Class: Tinker::Auth::AuthenticationManager

Inherits:
Object
  • Object
show all
Defined in:
lib/tinker/auth/authentication_manager.rb

Instance Method Summary collapse

Constructor Details

#initialize(config:, http_client:) ⇒ AuthenticationManager

Returns a new instance of AuthenticationManager.



10
11
12
13
14
15
# File 'lib/tinker/auth/authentication_manager.rb', line 10

def initialize(config:, http_client:)
  @config = config
  @http_client = http_client
  @token = nil
  @expires_at = nil
end

Instance Method Details

#tokenObject



17
18
19
20
21
# File 'lib/tinker/auth/authentication_manager.rb', line 17

def token
  return @token if token_valid?

  fetch_token
end