lib/ultra_config/namespace.rb in ultra_config-0.1.0 vs lib/ultra_config/namespace.rb in ultra_config-0.2.0
- old
+ new
@@ -1,12 +1,12 @@
require_relative 'config'
module UltraConfig
class Namespace
def initialize(&block)
- @objects = {}
- self.instance_eval(&block)
+ @configuration = block
+ reset
end
def namespace(name, &block)
@objects[name] = Namespace.new(&block)
end
@@ -23,8 +23,13 @@
end
end
def setting(name, value)
Settings.set(name, value)
+ end
+
+ def reset
+ @objects = {}
+ self.instance_eval(&@configuration)
end
end
end
\ No newline at end of file