Class: Mok::ItemList

Inherits:
Element show all
Defined in:
lib/mokelement.rb

Instance Attribute Summary

Attributes inherited from Element

#contents

Instance Method Summary collapse

Methods inherited from Element

#add=, #initialize

Constructor Details

This class inherits a constructor from Mok::Element

Instance Method Details

#applyObject



91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/mokelement.rb', line 91

def apply
  str = "<ItemList>"
  @contents.map  do |c|
    if c == :INDENT
      str += "<INDENT/>"
    elsif c == :DEDENT
      str +="<DEDENT/>"
    else
      str += "<ItemListItem>#{c.apply}</ItemListItem>"
    end
  end
  str += "</ItemList>"
  str
end