class Mok::NumList

Public Instance Methods

apply() click to toggle source
# File lib/mokelement.rb, line 107
def apply
  str = "<NumList>"
  num = 1
  @contents.map  do |c|
    if c == :INDENT
      str += "<INDENT/>"
    elsif c == :DEDENT
      str +="<DEDENT/>"
    else
      str += "<NumListItem>#{num}. #{c.apply}</NumListItem>"
      num += 1
    end
  end
  str += "</NumList>"
  str
end