Class: Hazetug::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/hazetug/config.rb

Constant Summary collapse

PATH =
File.expand_path("~/.hazetug")

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



19
20
21
# File 'lib/hazetug/config.rb', line 19

def [](key)
  @credentials[key]
end

.loadObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/hazetug/config.rb', line 8

def load
  Fog.credentials_path = PATH
  @credentials ||= begin
    if File.exist?(PATH)
      Psych.load_file(PATH)[Fog.credential.to_s]
    else
      {}
    end
  end
end