Method: MenuBar#initialize

Defined in:
lib/menu_bar.rb

#initialize(template, options = {}) {|_self| ... } ⇒ MenuBar

Returns a new instance of MenuBar.

Yields:

  • (_self)

Yield Parameters:

  • _self (MenuBar)

    the object that the method was called on



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/menu_bar.rb', line 11

def initialize(template, options = {})
  @template = template
  @options = options.reverse_merge(:theme => config[:default_theme_class], :remove_dangling_separators => true)
  config.merge! options[:config] if options[:config] # Allow per menu overriding of configuration
  config[:template] = @template

  @content = []
  @groups = [] # Subset of content that allows user to perform simpler non-sequential insertion into a particular group

  yield self if block_given?
end