Class: CTioga2::Commands::Documentation::MarkedUpText::MarkupText

Inherits:
MarkupItem
  • Object
show all
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

Attributes inherited from MarkupItem

#doc

Instance Method Summary collapse

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

#textObject

The text



56
57
58
# File 'lib/ctioga2/commands/doc/markup.rb', line 56

def text
  @text
end

Instance Method Details

#dump_stringObject



70
71
72
# File 'lib/ctioga2/commands/doc/markup.rb', line 70

def dump_string
  return "text: #{@text}"
end

#to_sObject



66
67
68
# File 'lib/ctioga2/commands/doc/markup.rb', line 66

def to_s
  return text
end