Module: Vendor::Config
Instance Method Summary collapse
- #directory ⇒ Object
- #directory=(dir) ⇒ Object
- #get(key) ⇒ Object
- #hash ⇒ Object
- #set(key, value) ⇒ Object
Instance Method Details
#directory ⇒ Object
9 10 11 |
# File 'lib/vendor/config.rb', line 9 def directory @directory ||= File.("~/.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 |
#hash ⇒ Object
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 |