Class: Acme::Authorizer::Configuration
- Inherits:
-
Object
- Object
- Acme::Authorizer::Configuration
- Defined in:
- lib/acme/authorizer/configuration.rb
Instance Method Summary collapse
- #add_token(token, key_authorization) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #key_authorization_for_token(token) ⇒ Object
- #valid_token?(token) ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
4 5 6 7 |
# File 'lib/acme/authorizer/configuration.rb', line 4 def initialize @tokens = {} add_tokens_from_env end |
Instance Method Details
#add_token(token, key_authorization) ⇒ Object
9 10 11 |
# File 'lib/acme/authorizer/configuration.rb', line 9 def add_token(token, ) @tokens[token] = end |
#key_authorization_for_token(token) ⇒ Object
17 18 19 |
# File 'lib/acme/authorizer/configuration.rb', line 17 def (token) @tokens[token] end |
#valid_token?(token) ⇒ Boolean
13 14 15 |
# File 'lib/acme/authorizer/configuration.rb', line 13 def valid_token?(token) @tokens.key?(token) end |