Class: Ramenu::Configuration

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::Configurable
Defined in:
lib/ramenu/config.rb

Overview

need a Class for 3.0

Instance Method Summary collapse

Instance Method Details

#add_menu(name, path = nil, options = {}, &block) ⇒ Object

create a new static menus in the configuration



39
40
41
42
# File 'lib/ramenu/config.rb', line 39

def add_menu(name, path = nil, options = {}, &block)
  menus = Ramenu.static_menus(options[:menu])
  Ramenu.add_menu_to(menus, name, path, options, &block)
end

#definer(name = nil, options = {}) {|rd| ... } ⇒ Object

common

Yields:

  • (rd)


21
22
23
24
25
26
27
28
29
30
# File 'lib/ramenu/config.rb', line 21

def definer(name = nil, options = {}, &block)
  # menus
  menus = Ramenu.static_menus(name)
  # flags
  flags = Ramenu.static_flags(name)

  # use a definer to allow block
  rd = RamenuDefiner.new(menus, flags, options)
  yield rd if block_given?
end

#set_flag(name, value = nil, options = {}) ⇒ Object

create a new static flag in the configuration



33
34
35
36
# File 'lib/ramenu/config.rb', line 33

def set_flag(name, value = nil, options = {})
  flags = Ramenu.static_flags(options[:flagset])
  Ramenu.set_flag_in(flags, name, value, options)
end