Class: Navtastic::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/navtastic/item.rb

Overview

A single menu item

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameString (readonly)

Returns the name to be displayed in the menu.

Returns:

  • (String)

    the name to be displayed in the menu


5
6
7
# File 'lib/navtastic/item.rb', line 5

def name
  @name
end

#urlString? (readonly)

Returns the url to link to, if item is a link.

Returns:

  • (String, nil)

    the url to link to, if item is a link


8
9
10
# File 'lib/navtastic/item.rb', line 8

def url
  @url
end

Instance Method Details

#current?Bool

Check if this item is the current item in the menu

Returns:

  • (Bool)

    if the item is the current item


28
29
30
# File 'lib/navtastic/item.rb', line 28

def current?
  @menu.current_item == self
end