class Disloku::Config::NamedConfigStore
Public Class Methods
new(config = nil)
click to toggle source
# File lib/disloku/config/NamedConfigStore.rb, line 8 def initialize(config = nil) @store = {} if (!config.nil?) load(config) end end
Public Instance Methods
add(name, yamlConfig)
click to toggle source
# File lib/disloku/config/NamedConfigStore.rb, line 23 def add(name, yamlConfig) @store[name] = transformConfig(yamlConfig) end
get(name)
click to toggle source
# File lib/disloku/config/NamedConfigStore.rb, line 15 def get(name) if (@store.has_key?(name)) return @store[name] else raise DislokuError.new("There is no stored object with the name '#{name}' in this store") end end
load(config)
click to toggle source
# File lib/disloku/config/NamedConfigStore.rb, line 27 def load(config) if (!config.nil?) config.value().each_key() do |key| add(key, config[key]) end end end
transformConfig(yamlConfig)
click to toggle source
# File lib/disloku/config/NamedConfigStore.rb, line 35 def transformConfig(yamlConfig) return yamlConfig end