Class: Docter::Page::ToCEntryForPage

Inherits:
ToCEntry show all
Defined in:
lib/docter/page.rb

Overview

ToC entry for a page. Obtains title and URL from the page, includes entries from the page ToC and can return the page itself.

Constant Summary

Constants inherited from ToC

ToC::ARRAY_METHODS

Instance Method Summary collapse

Methods inherited from ToCEntry

#to_html

Methods inherited from ToC

#add, from_yaml, #to_html

Constructor Details

#initialize(page) ⇒ ToCEntryForPage

:nodoc:



79
80
81
# File 'lib/docter/page.rb', line 79

def initialize(page)
  @page = page
end

Instance Method Details

#entriesObject



91
92
93
# File 'lib/docter/page.rb', line 91

def entries
  @page.toc.entries
end

#titleObject



83
84
85
# File 'lib/docter/page.rb', line 83

def title
  @page.title
end

#urlObject



87
88
89
# File 'lib/docter/page.rb', line 87

def url
  @page.path
end