Class: MenuBuilder::ViewHelpers::MenuItem
- Inherits:
-
Object
- Object
- MenuBuilder::ViewHelpers::MenuItem
- Defined in:
- lib/menu_builder/helper.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
Instance Method Summary collapse
-
#initialize(item, args, block) ⇒ MenuItem
constructor
A new instance of MenuItem.
- #link_to_in_context(context) ⇒ Object
- #to_sym ⇒ Object
Constructor Details
#initialize(item, args, block) ⇒ MenuItem
Returns a new instance of MenuItem.
13 14 15 |
# File 'lib/menu_builder/helper.rb', line 13 def initialize(item, args, block) @item, @args, @block = item, args, block end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
11 12 13 |
# File 'lib/menu_builder/helper.rb', line 11 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
11 12 13 |
# File 'lib/menu_builder/helper.rb', line 11 def block @block end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
11 12 13 |
# File 'lib/menu_builder/helper.rb', line 11 def item @item end |
Instance Method Details
#link_to_in_context(context) ⇒ Object
17 18 19 |
# File 'lib/menu_builder/helper.rb', line 17 def link_to_in_context context context.link_to *@args, &@block end |
#to_sym ⇒ Object
21 22 23 |
# File 'lib/menu_builder/helper.rb', line 21 def to_sym item.to_sym end |