Class: Raf::ItemList

Inherits:
Element show all
Defined in:
lib/rafelement.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 Raf::Element

Instance Method Details

#applyObject



85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rafelement.rb', line 85

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