提交 8cda1321 编写于 作者: T thedarkone

Make InheritableOptions's constructor more flexible.

上级 918dc273
......@@ -30,7 +30,7 @@ def config
superclass.config.inheritable_copy
else
# create a new "anonymous" class that will host the compiled reader methods
Class.new(Configuration).new({})
Class.new(Configuration).new
end
end
......
......@@ -36,8 +36,12 @@ def method_missing(name, *args)
end
class InheritableOptions < OrderedOptions
def initialize(parent)
super() { |h,k| parent[k] }
def initialize(parent = nil)
if parent
super() { |h,k| parent[k] }
else
super()
end
end
def inheritable_copy
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册