class Slaw::Grammars::Schedules::ScheduleTitle

Public Instance Methods

heading_text() click to toggle source
# File lib/slaw/grammars/schedules_nodes.rb, line 22
def heading_text
  if heading.empty? or heading.title.empty?
    nil
  else
    heading.title.elements
      .select { |x| x.instance_of? ::Slaw::Grammars::Inlines::InlineItem }
      .map { |x| x.text_value }
      .join('')
      .strip
  end
end
to_xml(b, idprefix=nil, heading_text) click to toggle source
# File lib/slaw/grammars/schedules_nodes.rb, line 34
def to_xml(b, idprefix=nil, heading_text)
  if not heading.empty? and not heading.title.empty?
    b.heading { |b| heading.title.to_xml(b, idprefix) }
  else
    b.heading(heading_text)
  end

  if not subheading.empty? and not subheading.title.empty?
    b.subheading { |b| subheading.title.to_xml(b, idprefix) }
  end
end