Class: Hpricot::Elem

Inherits:
Object show all
Defined in:
lib/undress.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#ancestorsObject



36
37
38
39
40
41
42
43
# File 'lib/undress.rb', line 36

def ancestors
  node, ancestors = parent, Elements[]
  while node.respond_to?(:parent) && node.parent
    ancestors << node
    node = node.parent
  end
  ancestors
end