Class: Slaw::Grammars::ZA::Act::Section
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- Slaw::Grammars::ZA::Act::Section
- Defined in:
- lib/slaw/grammars/za/act_nodes.rb
Instance Method Summary collapse
Instance Method Details
#num ⇒ Object
233 234 235 |
# File 'lib/slaw/grammars/za/act_nodes.rb', line 233 def num section_title.num end |
#to_xml(b, idprefix = '', *args) ⇒ Object
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/slaw/grammars/za/act_nodes.rb', line 237 def to_xml(b, idprefix='', *args) id = "sec_#{Slaw::Grammars::Counters.clean(num)}" # For historical reasons, we normally ignore the idprefix for sections, assuming # them to be unique. However, in an attachment (eg. a schedule), ensure they # are correctly prefixed # TODO: always include the idprefix id = idprefix + id if idprefix.start_with? 'att_' b.section(eId: id) { |b| section_title.to_xml(b) idprefix = "#{id}__" children.elements.each_with_index { |e, i| e.to_xml(b, idprefix, i) } } end |