Class: Slaw::Grammars::PL::Act::Chapter
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- Slaw::Grammars::PL::Act::Chapter
- Defined in:
- lib/slaw/grammars/pl/act_nodes.rb
Instance Method Summary collapse
Instance Method Details
#num ⇒ Object
174 175 176 |
# File 'lib/slaw/grammars/pl/act_nodes.rb', line 174 def num heading.num end |
#to_xml(b, *args) ⇒ Object
178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/slaw/grammars/pl/act_nodes.rb', line 178 def to_xml(b, *args) id = "chapter-#{num}" # TODO: do this for the oddzial and zial # include a part number in the id if our parent has one if parent and parent.parent.is_a?(Part) and parent.parent.num id = "part-#{parent.parent.num}.#{id}" end b.chapter(id: id) { |b| heading.to_xml(b) children.elements.each_with_index { |e, i| e.to_xml(b, id + '.', i) } } end |