Class: Concrete::Config
- Inherits:
-
Object
- Object
- Concrete::Config
- Defined in:
- lib/concrete/config.rb
Instance Method Summary collapse
-
#initialize(filename) ⇒ Config
constructor
A new instance of Config.
- #loadValue(key) ⇒ Object
- #storeValue(key, value) ⇒ Object
Constructor Details
#initialize(filename) ⇒ Config
Returns a new instance of Config.
7 8 9 |
# File 'lib/concrete/config.rb', line 7 def initialize(filename) @filename = filename end |
Instance Method Details
#loadValue(key) ⇒ Object
11 12 13 14 |
# File 'lib/concrete/config.rb', line 11 def loadValue(key) config = loadConfig config[key] if config.is_a?(Hash) end |
#storeValue(key, value) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/concrete/config.rb', line 16 def storeValue(key, value) config = loadConfig config[key] = value File.open(@filename, "w") do |f| YAML.dump(config, f) end end |