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_key ⇒ Object
PUBLIC: Return the current saved api_key If no key exists, prompt user for key.
-
.clear_api_key ⇒ Object
PUBLIC: Delete any existing api_key config file.
Class Method Details
.api_key ⇒ Object
PUBLIC: Return the current saved api_key If no key exists, prompt user for key
7 8 9 10 11 12 13 |
# File 'lib/awesomekit/authenticator.rb', line 7 def self.api_key if File.exist?(config) File.open(config, 'r').gets else prompt_user_for_key end end |
.clear_api_key ⇒ Object
PUBLIC: Delete any existing api_key config file
16 17 18 |
# File 'lib/awesomekit/authenticator.rb', line 16 def self.clear_api_key File.unlink(config) if File.exist?(config) end |