Class: Hpricot::Text
- Defined in:
- lib/hpricot/tag.rb,
lib/hpricot/inspect.rb,
lib/hpricot/modules.rb,
lib/hpricot/modules.rb
Direct Known Subclasses
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
Attributes inherited from BaseEle
Class Method Summary collapse
- .parse_cdata_content(raw_string) ⇒ Object
- .parse_cdata_section(content) ⇒ Object
- .parse_pcdata(raw_string) ⇒ Object
Instance Method Summary collapse
-
#initialize(text) ⇒ Text
constructor
A new instance of Text.
- #output(out, opts = {}) ⇒ Object
- #pathname ⇒ Object
- #pretty_print(q) ⇒ Object
- #to_s ⇒ Object (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 Hpricot
XML, build, build_node, make, parse, scan, uxs, xchr, xs
Methods inherited from BaseEle
alterable, #altered!, #html_quote, #if_output
Constructor Details
#initialize(text) ⇒ Text
Returns a new instance of Text.
139 140 141 |
# File 'lib/hpricot/tag.rb', line 139 def initialize(text) @content = text end |
Class Method Details
.parse_cdata_content(raw_string) ⇒ Object
239 240 241 242 |
# File 'lib/hpricot/parse.rb', line 239 def Text.parse_cdata_content(raw_string) result = CData.new(raw_string) result end |
Instance Method Details
#output(out, opts = {}) ⇒ Object
149 150 151 152 153 154 |
# File 'lib/hpricot/tag.rb', line 149 def output(out, opts = {}) out << if_output(opts) do @content end end |
#pathname ⇒ Object
143 |
# File 'lib/hpricot/tag.rb', line 143 def pathname; "text()" end |
#pretty_print(q) ⇒ Object
88 89 90 |
# File 'lib/hpricot/inspect.rb', line 88 def pretty_print(q) q.text @content.dump end |