class Nokogiri::XML::Node
def ancestors
##
def ancestors return [] unless respond_to?(:parent) parents = [parent] while parents.last.respond_to?(:parent) parents << parents.last.parent end parents end
def ancestors return [] unless respond_to?(:parent) parents = [parent] while parents.last.respond_to?(:parent) parents << parents.last.parent end parents end