Class: MenuBuilder::ViewHelpers::MenuItem

Inherits:
Object
  • Object
show all
Defined in:
lib/menu_builder/helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#argsObject (readonly)

Returns the value of attribute args.



10
11
12
# File 'lib/menu_builder/helper.rb', line 10

def args
  @args
end

#blockObject (readonly)

Returns the value of attribute block.



10
11
12
# File 'lib/menu_builder/helper.rb', line 10

def block
  @block
end

#itemObject (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



16
17
18
# File 'lib/menu_builder/helper.rb', line 16

def link_to_in_context context
  context.link_to *@args, &@block
end

#to_symObject



20
21
22
# File 'lib/menu_builder/helper.rb', line 20

def to_sym
  item.to_sym
end