Class: MenuBar::MenuBarTrigger

Inherits:
MenuBarItem show all
Defined in:
lib/menu_bar.rb

Constant Summary

Constants included from EasyMenu::Helpers

EasyMenu::Helpers::HTML_OPTIONS

Instance Attribute Summary

Attributes inherited from AbstractContent

#config, #content, #options

Instance Method Summary collapse

Methods inherited from AbstractItem

#disable_when, #disabled, #selected

Methods inherited from AbstractContent

#right_aligned?

Methods included from EasyMenu::Helpers

#config_name, #css_class, #html_option_keys, #merge_class, #wrap_content, #wrapper_element

Constructor Details

#initialize(config, content, menu, options) ⇒ MenuBarTrigger

Returns a new instance of MenuBarTrigger.



258
259
260
261
# File 'lib/menu_bar.rb', line 258

def initialize(config, content, menu, options)
  @menu = menu
  super(config, content, options)
end

Instance Method Details

#empty?Boolean

If the menu has no content, don’t show the menu bar trigger

Returns:

  • (Boolean)


264
265
266
# File 'lib/menu_bar.rb', line 264

def empty?
  @menu.empty?
end

#to_sObject



268
269
270
# File 'lib/menu_bar.rb', line 268

def to_s
  super + @menu.to_s
end