Class: RHC::Auth::TokenStore

Inherits:
Object
  • Object
show all
Defined in:
lib/rhc/auth/token_store.rb

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ TokenStore

Returns a new instance of TokenStore.



5
6
7
# File 'lib/rhc/auth/token_store.rb', line 5

def initialize(dir)
  @dir = dir
end

Instance Method Details

#clearObject



17
18
19
20
21
# File 'lib/rhc/auth/token_store.rb', line 17

def clear
  Dir[File.join(@dir, "token_*")].
    each{ |f| File.delete(f) unless File.directory?(f) }.
    present?
end

#get(login, server) ⇒ Object



9
10
11
# File 'lib/rhc/auth/token_store.rb', line 9

def get(, server)
  self[key(,server)]
end

#put(login, server, token) ⇒ Object



13
14
15
# File 'lib/rhc/auth/token_store.rb', line 13

def put(, server, token)
  self[key(,server)] = token
end