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.
Instance Attribute Summary collapse
-
#kind ⇒ Object
The kind of markup, nil means no markup.
-
#text ⇒ Object
The text.
Attributes inherited from MarkupItem
Instance Method Summary collapse
- #dump_string ⇒ Object
-
#initialize(doc, text = "", strip = true, kind = nil) ⇒ MarkupText
constructor
A new instance of MarkupText.
- #to_s ⇒ Object
Constructor Details
#initialize(doc, text = "", strip = true, kind = nil) ⇒ MarkupText
Returns a new instance of MarkupText.
60 61 62 63 64 65 66 67 68 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 60 def initialize(doc, text = "", strip = true, kind = nil) super(doc) @text = text @kind = kind if strip @text.gsub!(/\n/, " ") end end |
Instance Attribute Details
#kind ⇒ Object
The kind of markup, nil means no markup
58 59 60 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 58 def kind @kind end |
#text ⇒ Object
The text
55 56 57 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 55 def text @text end |
Instance Method Details
#dump_string ⇒ Object
74 75 76 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 74 def dump_string return "text: #{@text}" end |
#to_s ⇒ Object
70 71 72 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 70 def to_s return text end |