module Configuration::InstanceMethods
Attributes
name[R]
Public Class Methods
new(*argv, &block)
click to toggle source
# File lib/configuration.rb, line 66 def initialize *argv, &block options = Hash === argv.last ? argv.pop : Hash.new @name = argv.shift DSL.evaluate(self, options, &block) end
Public Instance Methods
dup()
click to toggle source
# File lib/configuration.rb, line 94 def dup ret = self.class.new @name each do |name| val = __send__ name.to_sym if Configuration === val val = val.dup val.instance_variable_set('@__parent', ret) DSL.evaluate(ret, name.to_sym => val) else DSL.evaluate(ret, name.to_sym => (val.dup rescue val)) end end ret end
each() { |v| ... }
click to toggle source
# File lib/configuration.rb, line 79 def each methods(false).each{|v| yield v } end
method_missing(m, *a, &b)
click to toggle source
Calls superclass method
# File lib/configuration.rb, line 72 def method_missing m, *a, &b return(Pure[@__parent].send m, *a, &b) rescue super if @__parent super end
to_hash()
click to toggle source
# File lib/configuration.rb, line 83 def to_hash inject({}){ |h,name| val = __send__(name.to_sym) h.update name.to_sym => Configuration === val ? val.to_hash : val } end
update(options = {})
click to toggle source
# File lib/configuration.rb, line 90 def update options = {}, &block DSL.evaluate(self, options, &block) end