Class: Confuse::Source::Yaml

Inherits:
Object
  • Object
show all
Defined in:
lib/confuse/source/yaml.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Yaml

Returns a new instance of Yaml.



8
9
10
# File 'lib/confuse/source/yaml.rb', line 8

def initialize(options = {})
  @yaml = ::YAML.load_file(options[:path])
end

Instance Method Details

#[](namespace, key) ⇒ Object



12
13
14
# File 'lib/confuse/source/yaml.rb', line 12

def [](namespace, key)
  namespace ? @yaml[namespace][key] : @yaml[key]
end