Class: Pslm::LatexOutputter::TitleFormatter

Inherits:
Formatter
  • Object
show all
Defined in:
lib/pslm/latexoutputter.rb

Overview

formats title

Constant Summary collapse

TEMPLATE =
{
  :no => "", # "" % anything => ""
  :plain => "%s\n\n",
  :semantic => "\\titulusPsalmi{%s}\n\n"
}

Instance Method Summary collapse

Methods inherited from Formatter

format, #initialize, #part_format, #strophe_format, #syllable_format, #verse_format, #word_format

Constructor Details

This class inherits a constructor from Pslm::LatexOutputter::Formatter

Instance Method Details

#psalm_format(text, psalm) ⇒ Object



387
388
389
390
391
392
393
394
395
396
397
# File 'lib/pslm/latexoutputter.rb', line 387

def psalm_format(text, psalm)
  if @options[:template].is_a? Symbol then
    return TEMPLATE[@options[:template]] % psalm.header.title +
      text
  elsif @options[:template].is_a? String then
    return @options[:template] % psalm.header.title +
      text
  else
    raise ArgumentError, "Don't know what to do with template of type #{@options[:template].class}."
  end
end