Class: Slaw::Grammars::ZA::Act::Chapter

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/slaw/grammars/za/act_nodes.rb

Instance Method Summary collapse

Instance Method Details

#numObject



203
204
205
# File 'lib/slaw/grammars/za/act_nodes.rb', line 203

def num
  heading.num
end

#to_xml(b, id_prefix = '', *args) ⇒ Object



207
208
209
210
211
212
213
214
# File 'lib/slaw/grammars/za/act_nodes.rb', line 207

def to_xml(b, id_prefix='', *args)
  id = id_prefix + "chp_#{Slaw::Grammars::Counters.clean(num)}"

  b.chapter(eId: id) { |b|
    heading.to_xml(b)
    children.elements.each_with_index { |e, i| e.to_xml(b, id + '__', i) }
  }
end