Class: Confy::Backend::Yaml

Inherits:
Hash
  • Object
show all
Defined in:
lib/confy/backend/yaml.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Yaml

Returns a new instance of Yaml.



4
5
6
7
# File 'lib/confy/backend/yaml.rb', line 4

def initialize path
  require "yaml"
  @config = ::YAML.load_file(path).to_ostruct
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



9
10
11
# File 'lib/confy/backend/yaml.rb', line 9

def method_missing *args
  @config.send args.shift
end