Class: Marsdawn::Site::PageNav
- Inherits:
-
Hash
- Object
- Hash
- Marsdawn::Site::PageNav
- Defined in:
- lib/marsdawn/site/page_nav.rb
Instance Method Summary collapse
-
#initialize(site, prev_page, next_page) ⇒ PageNav
constructor
A new instance of PageNav.
- #to_html ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(site, prev_page, next_page) ⇒ PageNav
Returns a new instance of PageNav.
6 7 8 9 10 |
# File 'lib/marsdawn/site/page_nav.rb', line 6 def initialize site, prev_page, next_page @site = site self[:prev_page] = @site.index[prev_page] unless prev_page.nil? self[:next_page] = @site.index[next_page] unless next_page.nil? end |
Instance Method Details
#to_html ⇒ Object
16 17 18 19 20 21 |
# File 'lib/marsdawn/site/page_nav.rb', line 16 def to_html %!<ul> <li id="nav-prev-page">#{self[:prev_page]}</li> <li id="nav-next-page">#{self[:next_page]}</li> </ul>! end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/marsdawn/site/page_nav.rb', line 12 def to_s to_html end |