Class: Slaw::Grammars::PL::Act::Division

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

Instance Method Summary collapse

Instance Method Details

#numObject



144
145
146
# File 'lib/slaw/grammars/pl/act_nodes.rb', line 144

def num
  heading.num
end

#to_xml(b, *args) ⇒ Object



148
149
150
151
152
153
154
155
# File 'lib/slaw/grammars/pl/act_nodes.rb', line 148

def to_xml(b, *args)
  id = "division-#{num}"

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