# File lib/hpricot/traverse.rb, line 805 805: def root 806: es = [] 807: children.each {|c| es << c if c.elem? } if children 808: raise Hpricot::Error, "no element" if es.empty? 809: raise Hpricot::Error, "multiple top elements" if 1 < es.length 810: es[0] 811: end
title searches title and return it as a text. It returns nil if not found.
title searchs following information.
# File lib/hpricot/traverse.rb, line 744 744: def title 745: e = find_element('title', 746: '{http://www.w3.org/1999/xhtml}title', 747: '{http://purl.org/rss/1.0/}title', 748: '{http://my.netscape.com/rdf/simple/0.9/}title') 749: e && e.extract_text 750: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.