Class: Hpricot::Doc
- Defined in:
- lib/hpricot/tag.rb,
lib/hpricot/inspect.rb,
lib/hpricot/modules.rb,
lib/hpricot/modules.rb
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, PREDEFINED, PREDEFINED_U, SELF_CLOSING_TAGS
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
Instance Method Summary collapse
- #altered! ⇒ Object
-
#initialize(children = [], options = {}) ⇒ Doc
constructor
A new instance of Doc.
- #make(input = nil, &blk) ⇒ Object
- #output(out, opts = {}) ⇒ Object
- #pretty_print(q) ⇒ Object
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 Hpricot
XML, build, build_node, make, parse, scan, uxs, xchr, xs
Constructor Details
#initialize(children = [], options = {}) ⇒ Doc
Returns a new instance of Doc.
6 7 8 9 |
# File 'lib/hpricot/tag.rb', line 6 def initialize(children = [], = {}) @children = children ? children.each { |c| c.parent = self } : [] @options = end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
5 6 7 |
# File 'lib/hpricot/tag.rb', line 5 def children @children end |
Instance Method Details
#altered! ⇒ Object
19 |
# File 'lib/hpricot/tag.rb', line 19 def altered!; end |
#make(input = nil, &blk) ⇒ Object
16 17 18 |
# File 'lib/hpricot/tag.rb', line 16 def make(input = nil, &blk) Hpricot.make(input, @options, &blk) end |
#output(out, opts = {}) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/hpricot/tag.rb', line 10 def output(out, opts = {}) @children.each do |n| n.output(out, opts) end 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 } } end |