Class: Awesomekit::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/awesomekit/authenticator.rb

Constant Summary collapse

CONFIG_FILE =
'.typekit'

Class Method Summary collapse

Class Method Details

.api_keyObject

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_keyObject

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