Module: Engine2::ActionMenuSupport

Instance Method Summary collapse

Instance Method Details



287
288
289
290
291
292
# File 'lib/engine2/action.rb', line 287

def menu menu_name, &blk
    @menus ||= {}
    @menus[menu_name] ||= ActionMenuBuilder.new(:root)
    @menus[menu_name].instance_eval(&blk) if blk
    @menus[menu_name]
end

Returns:

  • (Boolean)


294
295
296
# File 'lib/engine2/action.rb', line 294

def menu? menu_name
    @menus && @menus[menu_name]
end

#post_processObject



298
299
300
301
302
303
304
305
306
# File 'lib/engine2/action.rb', line 298

def post_process
    super
    if @menus && !@menus.empty?
        @meta[:menus] = {}
        @menus.each_pair do |name, menu|
            @meta[:menus][name] = {entries: menu.to_a, properties: menu.properties}
        end
    end
end