Class: Confuse::Source::Yaml
- Inherits:
-
Object
- Object
- Confuse::Source::Yaml
- Defined in:
- lib/confuse/source/yaml.rb
Instance Method Summary collapse
- #[](namespace, key) ⇒ Object
-
#initialize(options = {}) ⇒ Yaml
constructor
A new instance of Yaml.
Constructor Details
#initialize(options = {}) ⇒ Yaml
Returns a new instance of Yaml.
8 9 10 |
# File 'lib/confuse/source/yaml.rb', line 8 def initialize( = {}) @yaml = ::YAML.load_file([: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 |