Class: Slaw::ZA::Act::BlocklistItem

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

Instance Method Summary collapse

Instance Method Details

#contentObject



329
330
331
332
# File 'lib/slaw/za/act_nodes.rb', line 329

def content
  # TODO this really seems a bit odd
  item_content.content.text_value if respond_to? :item_content and item_content.respond_to? :content
end

#numObject



325
326
327
# File 'lib/slaw/za/act_nodes.rb', line 325

def num
  blocklist_item_prefix.text_value
end

#to_xml(b, idprefix) ⇒ Object



334
335
336
337
338
339
# File 'lib/slaw/za/act_nodes.rb', line 334

def to_xml(b, idprefix)
  b.item(id: idprefix + num.gsub(/[()]/, '')) { |b|
    b.num(num)
    b.p(content) if content
  }
end