Class: Hpricot::Text
- Inherits:
-
Basic
- Object
- Basic
- Hpricot::Text
- Includes:
- Leaf, 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
Defined Under Namespace
Modules: Trav
Constant Summary
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)
- - (Object) <<(str)
- - (Object) clear_raw
- - (Object) content
- - (Object) content=
-
- (Text) initialize(content)
constructor
A new instance of Text.
- - (Object) output(out, opts = {})
- - (Object) pathname
- - (Object) pretty_print(q)
- - (Object) raw_string
- - (Object) to_s (also: #inner_text, #to_plain_text)
Methods included from Trav
Methods included from Leaf::Trav
#traverse_all_element, #traverse_some_element, #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=, #make, #next, #node_position, #nodes_at, #position, #preceding, #previous, #procins?, #search, #swap, #text?, #to_html, #to_original_html, #traverse_element, #traverse_text, #xmldecl?, #xpath
Methods included from Node
#altered!, #html_quote, #if_output, #inspect_tree
Methods included from Hpricot
XML, build, css, make, parse, scan, uxs, xchr, xs
Constructor Details
- (Text) initialize(content)
A new instance of Text
136 |
# File 'lib/hpricot/tag.rb', line 136 def initialize content; self.content = content end |
Instance Method Details
- (Object) <<(str)
143 |
# File 'lib/hpricot/tag.rb', line 143 def << str; self.content << str end |
- (Object) clear_raw
- (Object) content
- (Object) content=
- (Object) output(out, opts = {})
144 145 146 147 148 149 |
# File 'lib/hpricot/tag.rb', line 144 def output(out, opts = {}) out << if_output(opts) do content.to_s end end |
- (Object) pathname
137 |
# File 'lib/hpricot/tag.rb', line 137 def pathname; "text()" end |
- (Object) pretty_print(q)
84 85 86 |
# File 'lib/hpricot/inspect.rb', line 84 def pretty_print(q) q.text content.dump end |
- (Object) raw_string
- (Object) to_s Also known as: inner_text, to_plain_text
138 139 140 |
# File 'lib/hpricot/tag.rb', line 138 def to_s Hpricot.uxs(content) end |