Class: Slaw::ZA::Act::Section

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

Instance Method Summary collapse

Instance Method Details

#numObject



181
182
183
# File 'lib/slaw/za/act_nodes.rb', line 181

def num
  section_title.num
end

#titleObject



185
186
187
# File 'lib/slaw/za/act_nodes.rb', line 185

def title
  section_title.title
end

#to_xml(b) ⇒ Object



189
190
191
192
193
194
195
196
197
198
199
# File 'lib/slaw/za/act_nodes.rb', line 189

def to_xml(b)
  id = "section-#{num}"
  b.section(id: id) { |b|
    b.num("#{num}.")
    b.heading(title)

    idprefix = "#{id}."

    subsections.elements.each_with_index { |e, i| e.to_xml(b, idprefix, i) }
  }
end