Module: Avm::EacAsciidoctorBase0::Sources::Document::Title

Defined in:
lib/avm/eac_asciidoctor_base0/sources/document/title.rb

Constant Summary collapse

TITLE_BASENAME =
'title'

Instance Method Summary collapse

Instance Method Details

#default_titleString

Returns:

  • (String)


13
14
15
# File 'lib/avm/eac_asciidoctor_base0/sources/document/title.rb', line 13

def default_title
  root_path.basename.to_s.humanize.split(/\s+/).map(&:upcase_first).join(' ')
end

#titleString

Returns:

  • (String)


18
19
20
# File 'lib/avm/eac_asciidoctor_base0/sources/document/title.rb', line 18

def title
  title_path.exist? ? title_path.read.strip : default_title
end

#title_pathPathname

Returns:

  • (Pathname)


23
24
25
# File 'lib/avm/eac_asciidoctor_base0/sources/document/title.rb', line 23

def title_path
  root_path.join(TITLE_BASENAME)
end