提交 c7b4f12d 编写于 作者: A Aaron Patterson

removing parameter requirement for matching_attributes

上级 06cc73cc
...@@ -197,19 +197,5 @@ def taken; nil end ...@@ -197,19 +197,5 @@ def taken; nil end
def skipped; nil end def skipped; nil end
def sources; [] end def sources; [] end
def locked; [] end def locked; [] end
private
def matching_attributes(attribute)
unless @matching_attributes
@matching_attributes = Hash[attributes.map do |a|
[a.root, a]
end]
end
[@matching_attributes[attribute.root]] || []
end
def has_attribute?(attribute)
!matching_attributes(attribute).empty?
end
end end
end end
...@@ -82,6 +82,15 @@ def reset ...@@ -82,6 +82,15 @@ def reset
@columns = nil @columns = nil
@attributes = Header.new([]) @attributes = Header.new([])
end end
private
def matching_attributes
@matching_attributes ||= Hash[attributes.map { |a| [a.root, true] }]
end
def has_attribute?(attribute)
matching_attributes.key? attribute.root
end
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册