Class: Slaw::Grammars::ZA::Act::ChapterHeading

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

Instance Method Summary collapse

Instance Method Details

#numObject



164
165
166
# File 'lib/slaw/grammars/za/act_nodes.rb', line 164

def num
  chapter_heading_prefix.alphanums.text_value
end

#titleObject



168
169
170
171
172
# File 'lib/slaw/grammars/za/act_nodes.rb', line 168

def title
  if heading.text_value and heading.respond_to? :content
    heading.content.text_value.strip
  end
end

#to_xml(b) ⇒ Object



174
175
176
177
# File 'lib/slaw/grammars/za/act_nodes.rb', line 174

def to_xml(b)
  b.num(num)
  b.heading(title) if title
end