Class: Arara::MenuItemComponent

Inherits:
ActionView::Component::Base
  • Object
show all
Includes:
BaseComponent
Defined in:
app/components/arara/menu_item_component.rb

Instance Method Summary collapse

Methods included from BaseComponent

#default_data_controller, #default_html_tag, #html_class, #html_content, #html_data, #html_tag, included

Constructor Details

#initialize(**kw) ⇒ MenuItemComponent

Returns a new instance of MenuItemComponent.



4
5
6
# File 'app/components/arara/menu_item_component.rb', line 4

def initialize(**kw)
  super(tag: "li", **kw)
end

Instance Method Details

#contentObject



19
20
21
# File 'app/components/arara/menu_item_component.rb', line 19

def content
  user_content
end

#default_html_classObject



8
9
10
# File 'app/components/arara/menu_item_component.rb', line 8

def default_html_class
  "mdc-list-item"
end

#html_optionsObject



12
13
14
15
16
17
# File 'app/components/arara/menu_item_component.rb', line 12

def html_options
  opts = super
  opts[:role] = "menuitem"
  opts[:tabindex] = "-1"
  opts
end