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.

Instance Attribute Summary collapse

Attributes inherited from MarkupItem

#doc

Instance Method Summary collapse

Constructor Details

#initialize(doc, text = "", strip = true, kind = nil) ⇒ MarkupText

Returns a new instance of MarkupText.



62
63
64
65
66
67
68
69
70
# File 'lib/ctioga2/commands/doc/markup.rb', line 62

def initialize(doc, text = "", strip = true, 
               kind = nil)
  super(doc)
  @text = text
  @kind = kind
  if strip
    @text.gsub!(/\n/, " ")
  end
end

Instance Attribute Details

#kindObject

The kind of markup, nil means no markup



60
61
62
# File 'lib/ctioga2/commands/doc/markup.rb', line 60

def kind
  @kind
end

#textObject

The text



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

def text
  @text
end

Instance Method Details

#dump_stringObject



76
77
78
# File 'lib/ctioga2/commands/doc/markup.rb', line 76

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

#to_sObject



72
73
74
# File 'lib/ctioga2/commands/doc/markup.rb', line 72

def to_s
  return text
end