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
12 13 14 |
# File 'lib/menu_builder/helper.rb', line 12 def initialize(item, args, block) @item, @args, @block = item, args, block end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
10 11 12 |
# File 'lib/menu_builder/helper.rb', line 10 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
10 11 12 |
# File 'lib/menu_builder/helper.rb', line 10 def block @block end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
10 11 12 |
# File 'lib/menu_builder/helper.rb', line 10 def item @item end |
Instance Method Details
#link_to_in_context(context) ⇒ Object
16 17 18 |
# File 'lib/menu_builder/helper.rb', line 16 def link_to_in_context context context.link_to *@args, &@block end |
#to_sym ⇒ Object
20 21 22 |
# File 'lib/menu_builder/helper.rb', line 20 def to_sym item.to_sym end |