Module: Vendor::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/vendor/config.rb

Instance Method Summary collapse

Instance Method Details

#directoryObject



9
10
11
# File 'lib/vendor/config.rb', line 9

def directory
  @directory ||= File.expand_path("~/.vendor")
end

#directory=(dir) ⇒ Object



13
14
15
# File 'lib/vendor/config.rb', line 13

def directory=(dir)
  @directory = dir
end

#get(key) ⇒ Object



23
24
25
# File 'lib/vendor/config.rb', line 23

def get(key)
  hash[key.to_sym]
end

#hashObject



27
28
29
# File 'lib/vendor/config.rb', line 27

def hash
  @hash ||= load_or_create
end

#set(key, value) ⇒ Object



17
18
19
20
21
# File 'lib/vendor/config.rb', line 17

def set(key, value)
  hash[key.to_sym] = value
  save
  value
end