Class: CTioga2::Commands::Documentation::MarkedUpText::MarkupText
- Inherits:
-
MarkupItem
- Object
- MarkupItem
- CTioga2::Commands::Documentation::MarkedUpText::MarkupText
- Defined in:
- lib/ctioga2/commands/doc/markup.rb
Overview
A markup item representing plain text.
TODO: in to_s a simple word-wrapping algorithm could be used.
Instance Attribute Summary collapse
-
#text ⇒ Object
The text.
Attributes inherited from MarkupItem
Instance Method Summary collapse
- #dump_string ⇒ Object
-
#initialize(doc, text = "", strip = true) ⇒ MarkupText
constructor
A new instance of MarkupText.
- #to_s ⇒ Object
Constructor Details
#initialize(doc, text = "", strip = true) ⇒ MarkupText
Returns a new instance of MarkupText.
58 59 60 61 62 63 64 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 58 def initialize(doc, text = "", strip = true) super(doc) @text = text if strip @text.gsub!(/\n/, " ") end end |
Instance Attribute Details
#text ⇒ Object
The text
56 57 58 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 56 def text @text end |
Instance Method Details
#dump_string ⇒ Object
70 71 72 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 70 def dump_string return "text: #{@text}" end |
#to_s ⇒ Object
66 67 68 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 66 def to_s return text end |