Class: Confy::Backend::Xml

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

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Xml



5
6
7
8
# File 'lib/confy/backend/xml.rb', line 5

def initialize path
  require "crack/xml"
  @config = ::Crack::XML.parse(::File.read(path)).to_ostruct
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



10
11
12
# File 'lib/confy/backend/xml.rb', line 10

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