Class: RailsMenuManager::MenuItem
- Inherits:
-
Object
- Object
- RailsMenuManager::MenuItem
- Defined in:
- lib/rails_menu_manager/menu_item.rb
Overview
Representation of a single menu item
Constant Summary collapse
- PATH_SEPARATOR =
0x1F.chr
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #in?(*args) ⇒ Boolean
-
#initialize(path, options = {}) ⇒ MenuItem
constructor
A new instance of MenuItem.
Constructor Details
#initialize(path, options = {}) ⇒ MenuItem
Returns a new instance of MenuItem.
10 11 12 13 |
# File 'lib/rails_menu_manager/menu_item.rb', line 10 def initialize(path, = {}) @path = path @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/rails_menu_manager/menu_item.rb', line 8 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/rails_menu_manager/menu_item.rb', line 8 def path @path end |
Instance Method Details
#in?(*args) ⇒ Boolean
15 16 17 18 19 |
# File 'lib/rails_menu_manager/menu_item.rb', line 15 def in?(*args) return false if path.nil? (path_as_string(path) =~ /\A#{path_as_string(args)}/i) end |