Class: Mok::NumList
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
Methods inherited from Element
Constructor Details
This class inherits a constructor from Mok::Element
Instance Method Details
#apply ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/mokelement.rb', line 108 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 |