lib/ramenu/ramenu_methods.rb in ramenu-3.0.0 vs lib/ramenu/ramenu_methods.rb in ramenu-3.0.1
- old
+ new
@@ -1,9 +1,10 @@
module Ramenu
+
# flags
def self.static_flags(flagset = nil)
- flagset = DEFAULT_GROUP if flagset.nil?
+ flagset = DEFAULT_GROUP if flagset.nil?
@ramenu_flags ||= {}
@ramenu_flags[flagset] ||= {}
end
# return static menus
@@ -22,9 +23,11 @@
menu << new_ramenu_element(name, path, options, &block)
end
# create a new menu element
def self.new_ramenu_element(name, path = nil, options = {}, &block)
+ options[:flag] = name if options[:flag_for_menu] == true && name.is_a?(Symbol)
+
elem = Menus::Element.new(name, path, options)
yield elem if block_given?
return elem
end