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

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

#argsObject (readonly)

Returns the value of attribute args.



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

def args
  @args
end

#blockObject (readonly)

Returns the value of attribute block.



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

def block
  @block
end

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



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

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

#to_symObject



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

def to_sym
  item.to_sym
end