Class: Slaw::Grammars::ZA::Act::Part

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

Instance Method Summary collapse

Instance Method Details

#numObject



136
137
138
# File 'lib/slaw/grammars/za/act_nodes.rb', line 136

def num
  heading.num
end

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



140
141
142
143
144
145
146
147
# File 'lib/slaw/grammars/za/act_nodes.rb', line 140

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

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