Class: Infoboxer::Tree::Text
Overview
Direct Known Subclasses
Instance Attribute Summary collapse
-
#raw_text ⇒ Object
Text fragment without decodint of HTML entities.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(text, **params) ⇒ Text
constructor
A new instance of Text.
-
#text ⇒ Object
See Node#text.
-
#to_tree(level = 0) ⇒ Object
See Node#to_tree.
Methods inherited from Node
#==, #children, coder, def_readers, #first?, #index, #inspect, #next_siblings, #prev_siblings, #siblings, #text_, #to_s
Methods included from Navigation::Wikipath
Methods included from Navigation::Sections::Node
Methods included from Navigation::Shortcuts::Node
#bold?, #categories, #external_links, #heading?, #headings, #images, #infobox, #infoboxes, #italic?, #lists, #paragraphs, #tables, #templates, #wikilinks
Methods included from Navigation::Lookup::Node
#_lookup, #_lookup_children, #_lookup_next_siblings, #_lookup_parents, #_lookup_prev_sibling, #_lookup_prev_siblings, #_lookup_siblings, #_matches?, #lookup, #lookup_children, #lookup_next_siblings, #lookup_parents, #lookup_prev_sibling, #lookup_prev_siblings, #lookup_siblings, #matches?, #parent?
Constructor Details
#initialize(text, **params) ⇒ Text
Returns a new instance of Text.
16 17 18 19 |
# File 'lib/infoboxer/tree/text.rb', line 16 def initialize(text, **params) super(params) @raw_text = text end |
Instance Attribute Details
#raw_text ⇒ Object
Text fragment without decodint of HTML entities.
14 15 16 |
# File 'lib/infoboxer/tree/text.rb', line 14 def raw_text @raw_text end |
Instance Method Details
#text ⇒ Object
See Node#text
22 23 24 |
# File 'lib/infoboxer/tree/text.rb', line 22 def text @text ||= decode(@raw_text) end |
#to_tree(level = 0) ⇒ Object
See Node#to_tree
27 28 29 |
# File 'lib/infoboxer/tree/text.rb', line 27 def to_tree(level = 0) "#{indent(level)}#{text} <#{descr}>\n" end |