Module: PivotalTracker::Setup::API::Authentication

Defined in:
lib/pivotal-tracker-console/setup.rb

Class Method Summary collapse

Class Method Details

.has_token?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/pivotal-tracker-console/setup.rb', line 6

def has_token?
  File.exist? filename
end

.tokenObject



14
15
16
# File 'lib/pivotal-tracker-console/setup.rb', line 14

def token
  @token ||= YAML.load_file(filename)['token']
end

.token=(token) ⇒ Object



10
11
12
# File 'lib/pivotal-tracker-console/setup.rb', line 10

def token=(token)
  File.open(filename, 'w') { |file| file.write "token: #{token}" }
end