Added Attribute#each_ancestor

This commit is contained in:
Yorick Peterse committed 2015-08-26 22:26:46 +02:00
1 parent 083d048e63
commit 9899a419b7
2 files changed
+34 -4

No files matched your search

+9
View File
@@ -125,6 +125,15 @@ module Oga
"Attribute(#{segments.join(' ')})"
end
# @see [Oga::XML::Node#each_ancestor]
def each_ancestor(&block)
return unless element
yield element
element.each_ancestor(&block)
end
private
##