Class: Fizzy::StaticTokenProvider
- Inherits:
-
Object
- Object
- Fizzy::StaticTokenProvider
- Includes:
- TokenProvider
- Defined in:
- lib/fizzy/static_token_provider.rb
Overview
A simple token provider that returns a static access token. Useful for testing or when you manage token refresh externally.
Instance Method Summary collapse
-
#access_token ⇒ String
The access token.
-
#initialize(token) ⇒ StaticTokenProvider
constructor
A new instance of StaticTokenProvider.
Methods included from TokenProvider
Constructor Details
#initialize(token) ⇒ StaticTokenProvider
Returns a new instance of StaticTokenProvider.
13 14 15 16 17 |
# File 'lib/fizzy/static_token_provider.rb', line 13 def initialize(token) raise ArgumentError, "token cannot be nil or empty" if token.nil? || token.empty? @token = token end |
Instance Method Details
#access_token ⇒ String
Returns the access token.
20 21 22 |
# File 'lib/fizzy/static_token_provider.rb', line 20 def access_token @token end |