Class: Coradoc::Html::Drop::TocEntryDrop

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/html/drop/toc_entry_drop.rb

Instance Attribute Summary

Attributes inherited from Base

#model

Instance Method Summary collapse

Methods inherited from Base

#id, #initialize, #template_type, #to_liquid

Constructor Details

This class inherits a constructor from Coradoc::Html::Drop::Base

Instance Method Details

#childrenObject



19
20
21
# File 'lib/coradoc/html/drop/toc_entry_drop.rb', line 19

def children
  children_to_liquid(@model.children)
end

#levelObject



15
16
17
# File 'lib/coradoc/html/drop/toc_entry_drop.rb', line 15

def level
  @model.level
end

#numberObject



11
12
13
# File 'lib/coradoc/html/drop/toc_entry_drop.rb', line 11

def number
  @model.number
end

#numbered_titleObject



23
24
25
26
# File 'lib/coradoc/html/drop/toc_entry_drop.rb', line 23

def numbered_title
  n = number
  n ? "#{n}. #{title}" : title
end

#titleObject



7
8
9
# File 'lib/coradoc/html/drop/toc_entry_drop.rb', line 7

def title
  TitleText.escape(@model.title)
end