<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,3 +2,4 @@
 pkg/
 tmp/
 doc/
+*.swp</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -40,9 +40,9 @@ module DaemonKit
     # Expects a hash, looks for DAEMON_ENV key
     def initialize( config_data ) #:nodoc:
       if config_data.has_key?( DAEMON_ENV )
-        @data = config_data[ DAEMON_ENV ]
+        self.data = config_data[ DAEMON_ENV ]
       else
-        @data = config_data
+        self.data = config_data
       end
     end
 
@@ -54,17 +54,55 @@ module DaemonKit
     # Return the internal hash structure used, optionally symbolizing
     # the first level of keys in the hash
     def to_h( symbolize = false )
-      symbolize ? @data.inject({}) { |m,c| m[c[0].to_sym] = c[1]; m } : @data
+      symbolize ? @data.symbolize_keys : @data
     end
 
     def method_missing( method_name, *args ) #:nodoc:
-      # don't match setters
       unless method_name.to_s =~ /[\w_]+=$/
-        # pick a key if we have it
-        return @data[ method_name.to_s ] if @data.keys.include?( method_name.to_s )
+        if @data.keys.include?( method_name.to_s )
+          return @data.send( method_name.to_s )
+        end
       end
 
       super
     end
+
+    def data=( hash )
+      @data = hash
+      class &lt;&lt; @data
+        def symbolize_keys( hash = self )
+          hash.inject({}) { |result, (key, value)|
+            new_key = case key
+                    when String then key.to_sym
+                    else key
+                    end
+            new_value = case value
+                    when Hash then symbolize_keys(value)
+                    else value
+                    end
+            result[new_key] = new_value
+            result
+          }
+        end
+      end
+
+      extend_hash( @data )
+    end
+
+    def extend_hash( hash )
+      hash.keys.each do |k|
+        hash.instance_eval &lt;&lt;-KEY
+          def #{k}
+            fetch(&quot;#{k}&quot;)
+          end
+        KEY
+      end
+
+      hash.each do |(key, value)|
+        case value
+          when Hash then extend_hash( value )
+        end
+      end
+    end
   end
 end</diff>
      <filename>lib/daemon_kit/config.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ describe DaemonKit::Config do
 
   describe &quot;working with config data&quot; do
     before(:each) do
-      @config = DaemonKit::Config.new('foo' =&gt; 'bar')
+      @config = DaemonKit::Config.new('foo' =&gt; 'bar', 'nes' =&gt; { 'ted' =&gt; 'value' })
     end
 
     it &quot;should have string key access to values&quot; do
@@ -19,15 +19,17 @@ describe DaemonKit::Config do
       @config.foo.should == 'bar'
     end
 
-    it &quot;should return the config as a has&quot; do
-      @config.to_h.should == { 'foo' =&gt; 'bar' }
+    it &quot;should have nested instance accessors to values&quot; do
+      @config.nes.ted.should == 'value'
     end
 
-    it &quot;should be able to symbolize keys in returned hash&quot; do
-      @config.to_h(true).should == { :foo =&gt; 'bar' }
+    it &quot;should return the config as a hash&quot; do
+      @config.to_h.should == { 'foo' =&gt; 'bar', 'nes' =&gt; { 'ted' =&gt; 'value' } }
     end
 
-    it &quot;should symbolize keys in a nested fashion&quot;
+    it &quot;should be able to symbolize keys in returned hash&quot; do
+      @config.to_h(true).should == { :foo =&gt; 'bar', :nes =&gt; { :ted =&gt; 'value' } }
+    end
   end
 
   describe &quot;parsing files&quot; do</diff>
      <filename>spec/config_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>60dc03f4a81e253a8e37421dee29db6447fee676</id>
    </parent>
  </parents>
  <author>
    <name>Kenneth Kalmer</name>
    <email>kenneth.kalmer@gmail.com</email>
  </author>
  <url>http://github.com/kennethkalmer/daemon-kit/commit/89e20f68fb13c32e4054da0f8b3d675d0b29c12c</url>
  <id>89e20f68fb13c32e4054da0f8b3d675d0b29c12c</id>
  <committed-date>2009-07-16T13:43:35-07:00</committed-date>
  <authored-date>2009-07-16T13:43:07-07:00</authored-date>
  <message>Improved config hash</message>
  <tree>4ee0f1136af049c60b9c3f747b163dbf65658989</tree>
  <committer>
    <name>Kenneth Kalmer</name>
    <email>kenneth.kalmer@gmail.com</email>
  </committer>
</commit>
