Class: Hpricot::Elem
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#ancestors ⇒ Object
69 70 71 72 73 74 75 76 |
# File 'lib/hpricot_ext.rb', line 69 def ancestors node, ancestors = parent, Elements[] while node.respond_to?(:parent) && node.parent ancestors << node node = node.parent end ancestors end |
#change_tag!(new_tag, preserve_attr = true) ⇒ Object
78 79 80 81 82 |
# File 'lib/hpricot_ext.rb', line 78 def change_tag!(new_tag, preserve_attr = true) return if not etag self.name = new_tag attributes.each {|k,v| remove_attribute(k)} if not preserve_attr end |