Class: CTioga2::Commands::Documentation::MarkedUpText::MarkupItemize

Inherits:
MarkupItem
  • Object
show all
Defined in:
lib/ctioga2/commands/doc/markup.rb

Overview

An itemize object

Instance Attribute Summary collapse

Attributes inherited from MarkupItem

#doc

Instance Method Summary collapse

Constructor Details

#initialize(doc, items = []) ⇒ MarkupItemize

Returns a new instance of MarkupItemize.



149
150
151
152
# File 'lib/ctioga2/commands/doc/markup.rb', line 149

def initialize(doc, items = [])
  super(doc)
  @items = items
end

Instance Attribute Details

#itemsObject

An array of arrays of MarkupItem, each representing an element of the itemize object.



147
148
149
# File 'lib/ctioga2/commands/doc/markup.rb', line 147

def items
  @items
end

Instance Method Details

#dump_stringObject



166
167
168
169
170
# File 'lib/ctioga2/commands/doc/markup.rb', line 166

def dump_string
  return @items.map {|x|
    "* #{x.map do |y| y.dump_string; end}\n"
  }.join('')
end

#to_sObject



154
155
156
157
158
159
160
161
162
163
164
# File 'lib/ctioga2/commands/doc/markup.rb', line 154

def to_s
  str = ""
  for i in @items
    str << " * "
    for j in i
      str << j.to_s 
    end
    str << "\n"
  end
  return str
end