Class: Hpricot::Doc

Inherits:
Elem show all
Includes:
Container, Trav
Defined in:
lib/hpricot/tag.rb,
lib/hpricot/inspect.rb,
lib/hpricot/modules.rb,
lib/hpricot/modules.rb,
ext/hpricot_scan/hpricot_scan.c

Overview

:stopdoc:

Defined Under Namespace

Modules: Trav

Constant Summary

Constants included from Hpricot

AttrCore, AttrEvents, AttrFocus, AttrHAlign, AttrI18n, AttrVAlign, Attrs, ElementContent, ElementExclusions, ElementInclusions, FORM_TAGS, NamedCharacters, NamedCharactersPattern, OmittedAttrName, SELF_CLOSING_TAGS

Instance Method Summary collapse

Methods included from Trav

#author, #css_path, #root, #title, #traverse_all_element, #traverse_some_element, #xpath

Methods included from Container::Trav

#classes, #containers, #each_child, #each_child_with_index, #each_hyperlink, #each_hyperlink_uri, #each_uri, #filter, #find_element, #following_siblings, #get_element_by_id, #get_elements_by_tag_name, #insert_after, #insert_before, #next_sibling, #preceding_siblings, #previous_sibling, #replace_child, #siblings_at, #traverse_text_internal

Methods included from Traverse

#after, #at, #before, #bogusetag?, #children_of_type, #clean_path, #comment?, #css_path, #doc?, #doctype?, #elem?, filter, #following, #get_subnode, #html, #index, #inner_html=, #inner_text, #next, #node_position, #nodes_at, #position, #preceding, #previous, #procins?, #search, #swap, #text?, #to_html, #to_original_html, #to_plain_text, #traverse_element, #traverse_text, #xmldecl?, #xpath

Methods included from Node

#clear_raw, #html_quote, #if_output, #pathname

Methods included from Hpricot

XML, build, css, make, parse, scan, uxs, xchr, xs

Instance Method Details

#altered!Object


14
# File 'lib/hpricot/tag.rb', line 14

def altered!; end

#inspect_treeObject


15
16
17
# File 'lib/hpricot/tag.rb', line 15

def inspect_tree
  children.map { |x| x.inspect_tree }.join if children
end

#make(input = nil, &blk) ⇒ Object


11
12
13
# File 'lib/hpricot/tag.rb', line 11

def make(input = nil, &blk)
  Hpricot.make(input, @options, &blk).children
end

#output(out, opts = {}) ⇒ Object


5
6
7
8
9
10
# File 'lib/hpricot/tag.rb', line 5

def output(out, opts = {})
  children.each do |n|
    n.output(out, opts)
  end if children
  out
end

#pretty_print(q) ⇒ Object


13
14
15
# File 'lib/hpricot/inspect.rb', line 13

def pretty_print(q)
  q.object_group(self) { children.each {|elt| q.breakable; q.pp elt } if children }
end