Class: Awesomekit::Authenticator
- Inherits:
-
Object
- Object
- Awesomekit::Authenticator
- Defined in:
- lib/awesomekit/authenticator.rb
Constant Summary collapse
- CONFIG_FILE =
'.typekit'
Class Method Summary collapse
-
.api_token ⇒ Object
PUBLIC: Return the current saved api_token If no token exists, prompt user for token.
-
.clear_api_token ⇒ Object
PUBLIC: Delete any existing api_token config file.
Class Method Details
.api_token ⇒ Object
PUBLIC: Return the current saved api_token If no token exists, prompt user for token
7 8 9 10 11 12 13 |
# File 'lib/awesomekit/authenticator.rb', line 7 def self.api_token if File.exist?(config) File.open(config, 'r').gets else prompt_user_for_token end end |
.clear_api_token ⇒ Object
PUBLIC: Delete any existing api_token config file
16 17 18 |
# File 'lib/awesomekit/authenticator.rb', line 16 def self.clear_api_token File.unlink(config) if File.exist?(config) end |