Class: Madness::Navigation
- Inherits:
-
Object
- Object
- Madness::Navigation
- Includes:
- ServerHelper
- Defined in:
- lib/madness/navigation.rb
Overview
Handle the navigation links for a given directory
Instance Attribute Summary collapse
-
#caption ⇒ Object
readonly
Returns the value of attribute caption.
-
#links ⇒ Object
readonly
Returns the value of attribute links.
Instance Method Summary collapse
-
#initialize(dir) ⇒ Navigation
constructor
A new instance of Navigation.
- #with_search? ⇒ Boolean
Methods included from ServerHelper
Constructor Details
#initialize(dir) ⇒ Navigation
Returns a new instance of Navigation.
8 9 10 11 12 |
# File 'lib/madness/navigation.rb', line 8 def initialize(dir) @links = make_links dir # @caption = File.basename(dir) unless dir == docroot @caption = dir == docroot ? "Index" : File.basename(dir) end |
Instance Attribute Details
#caption ⇒ Object (readonly)
Returns the value of attribute caption.
6 7 8 |
# File 'lib/madness/navigation.rb', line 6 def caption @caption end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
6 7 8 |
# File 'lib/madness/navigation.rb', line 6 def links @links end |
Instance Method Details
#with_search? ⇒ Boolean
14 15 16 |
# File 'lib/madness/navigation.rb', line 14 def with_search? @with_search ||= Search.new.has_index? end |