Class: MiddlemanToc::Toc
- Inherits:
-
Struct
- Object
- Struct
- MiddlemanToc::Toc
- Defined in:
- lib/middleman_toc/toc.rb
Instance Attribute Summary collapse
-
#pages ⇒ Object
Returns the value of attribute pages.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize ⇒ Toc
constructor
A new instance of Toc.
- #next_page(path) ⇒ Object
- #prev_page(path) ⇒ Object
- #toc(path) ⇒ Object
Constructor Details
Instance Attribute Details
#pages ⇒ Object
Returns the value of attribute pages
4 5 6 |
# File 'lib/middleman_toc/toc.rb', line 4 def pages @pages end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
5 6 7 |
# File 'lib/middleman_toc/toc.rb', line 5 def root @root end |
Instance Method Details
#next_page(path) ⇒ Object
22 23 24 25 |
# File 'lib/middleman_toc/toc.rb', line 22 def next_page(path) node = next_node(path) Tag.new(:a, 'Next', class: 'next', href: "/#{node.path}.html").render if node && node.path end |