Class: Concrete::Config

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

Instance Method Summary collapse

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