提交 d3ccfe41 编写于 作者: C Clemens Kofler 提交者: Jeremy Kemper

Whitespace.

Signed-off-by: NJeremy Kemper <jeremy@bitsweat.net>
上级 288e947a
...@@ -91,14 +91,14 @@ def class_inheritable_hash(*syms) ...@@ -91,14 +91,14 @@ def class_inheritable_hash(*syms)
def inheritable_attributes def inheritable_attributes
@inheritable_attributes ||= EMPTY_INHERITABLE_ATTRIBUTES @inheritable_attributes ||= EMPTY_INHERITABLE_ATTRIBUTES
end end
def write_inheritable_attribute(key, value) def write_inheritable_attribute(key, value)
if inheritable_attributes.equal?(EMPTY_INHERITABLE_ATTRIBUTES) if inheritable_attributes.equal?(EMPTY_INHERITABLE_ATTRIBUTES)
@inheritable_attributes = {} @inheritable_attributes = {}
end end
inheritable_attributes[key] = value inheritable_attributes[key] = value
end end
def write_inheritable_array(key, elements) def write_inheritable_array(key, elements)
write_inheritable_attribute(key, []) if read_inheritable_attribute(key).nil? write_inheritable_attribute(key, []) if read_inheritable_attribute(key).nil?
write_inheritable_attribute(key, read_inheritable_attribute(key) + elements) write_inheritable_attribute(key, read_inheritable_attribute(key) + elements)
...@@ -112,7 +112,7 @@ def write_inheritable_hash(key, hash) ...@@ -112,7 +112,7 @@ def write_inheritable_hash(key, hash)
def read_inheritable_attribute(key) def read_inheritable_attribute(key)
inheritable_attributes[key] inheritable_attributes[key]
end end
def reset_inheritable_attributes def reset_inheritable_attributes
@inheritable_attributes = EMPTY_INHERITABLE_ATTRIBUTES @inheritable_attributes = EMPTY_INHERITABLE_ATTRIBUTES
end end
...@@ -123,7 +123,7 @@ def reset_inheritable_attributes ...@@ -123,7 +123,7 @@ def reset_inheritable_attributes
def inherited_with_inheritable_attributes(child) def inherited_with_inheritable_attributes(child)
inherited_without_inheritable_attributes(child) if respond_to?(:inherited_without_inheritable_attributes) inherited_without_inheritable_attributes(child) if respond_to?(:inherited_without_inheritable_attributes)
if inheritable_attributes.equal?(EMPTY_INHERITABLE_ATTRIBUTES) if inheritable_attributes.equal?(EMPTY_INHERITABLE_ATTRIBUTES)
new_inheritable_attributes = EMPTY_INHERITABLE_ATTRIBUTES new_inheritable_attributes = EMPTY_INHERITABLE_ATTRIBUTES
else else
...@@ -131,7 +131,7 @@ def inherited_with_inheritable_attributes(child) ...@@ -131,7 +131,7 @@ def inherited_with_inheritable_attributes(child)
memo.update(key => value.duplicable? ? value.dup : value) memo.update(key => value.duplicable? ? value.dup : value)
end end
end end
child.instance_variable_set('@inheritable_attributes', new_inheritable_attributes) child.instance_variable_set('@inheritable_attributes', new_inheritable_attributes)
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册