Class: Slaw::ZA::Act::Subsection

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

Instance Method Summary collapse

Instance Method Details

#numObject



262
263
264
# File 'lib/slaw/za/act_nodes.rb', line 262

def num
  subsection_prefix.num.text_value
end

#to_xml(b, idprefix, i) ⇒ Object



266
267
268
269
270
271
272
273
274
275
276
# File 'lib/slaw/za/act_nodes.rb', line 266

def to_xml(b, idprefix, i)
  id = idprefix + num.gsub(/[()]/, '')
  idprefix = id + "."

  b.subsection(id: id) { |b|
    b.num(num)
    b.content { |b|
      children.elements.each_with_index { |e, i| e.to_xml(b, idprefix, i) }
    }
  }
end