Module: Redmine::MenuManager

Defined in:
lib/redmine/menu_manager.rb

Overview

Since:

  • 0.6.0

Defined Under Namespace

Modules: MenuController, MenuHelper Classes: Mapper, MenuItem, MenuNode

Class Method Summary collapse

Class Method Details

.items(menu_name) ⇒ Object



242
243
244
# File 'lib/redmine/menu_manager.rb', line 242

def items(menu_name)
  @items[menu_name.to_sym] || MenuNode.new(:root, {})
end

.map(menu_name) ⇒ Object



232
233
234
235
236
237
238
239
240
# File 'lib/redmine/menu_manager.rb', line 232

def map(menu_name)
  @items ||= {}
  mapper = Mapper.new(menu_name.to_sym, @items)
  if block_given?
    yield mapper
  else
    mapper
  end
end