Class: Slaw::ZA::Act::Blocklist

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

Instance Method Summary collapse

Instance Method Details

#to_xml(b, idprefix, i = 0, &block) ⇒ Object

Render a block list to xml. If a block is given, yield to it a builder to insert a listIntroduction node



343
344
345
346
347
348
349
350
351
352
# File 'lib/slaw/za/act_nodes.rb', line 343

def to_xml(b, idprefix, i=0, &block)
  id = idprefix + "list#{i}"
  idprefix = id + '.'

  b.blockList(id: id) { |b|
    b.listIntroduction { |b| yield b } if block_given?

    elements.each { |e| e.to_xml(b, idprefix) }
  }
end