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.



133
134
135
136
# File 'lib/ctioga2/commands/doc/markup.rb', line 133

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.



131
132
133
# File 'lib/ctioga2/commands/doc/markup.rb', line 131

def items
  @items
end

Instance Method Details

#dump_stringObject



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

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

#to_sObject



138
139
140
141
142
143
144
145
146
147
148
# File 'lib/ctioga2/commands/doc/markup.rb', line 138

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