Class: Infoboxer::Tree::Text
Overview
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, #index, #inspect, #next_siblings, #prev_siblings, #siblings, #text_, #to_s
Methods included from Navigation::Sections::Node
Methods included from Navigation::Shortcuts::Node
#bold?, #categories, #external_links, #heading?, #headings, #images, #infoboxes, #italic?, #lists, #paragraphs, #tables, #templates, #wikilinks
Methods included from Navigation::Lookup::Node
#_lookup, #_lookup_children, #_lookup_next_siblings, #_lookup_parents, #_lookup_prev_siblings, #_lookup_siblings, #_matches?, #has_parent?, #lookup, #lookup_children, #lookup_next_siblings, #lookup_parents, #lookup_prev_siblings, #lookup_siblings, #matches?
Constructor Details
#initialize(text, params = {}) ⇒ Text
Returns a new instance of Text.
17 18 19 20 |
# File 'lib/infoboxer/tree/text.rb', line 17 def initialize(text, params = {}) super(params) @raw_text = text end |
Instance Attribute Details
#raw_text ⇒ Object
Text fragment without decodint of HTML entities.
15 16 17 |
# File 'lib/infoboxer/tree/text.rb', line 15 def raw_text @raw_text end |
Instance Method Details
#text ⇒ Object
See Node#text
23 24 25 |
# File 'lib/infoboxer/tree/text.rb', line 23 def text @text ||= decode(@raw_text) end |
#to_tree(level = 0) ⇒ Object
See Node#to_tree
28 29 30 |
# File 'lib/infoboxer/tree/text.rb', line 28 def to_tree(level = 0) "#{indent(level)}#{text} <#{descr}>\n" end |