class AppCfg::YamlSource
Public Class Methods
new(options = {})
click to toggle source
# File lib/appcfg/sources/yaml_source.rb, line 3 def initialize(options = {}) @filename = options[:file] @namespace = options[:env] end
Public Instance Methods
reload_data!()
click to toggle source
# File lib/appcfg/sources/yaml_source.rb, line 8 def reload_data! yaml_structure = YAML.load(File.open @filename) || {} # empty hash instead of false when file is empty @hash = @namespace ? yaml_structure[@namespace]||{} : yaml_structure end