Class: Trek::MenuComponent::SectionComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Trek::MenuComponent::SectionComponent
show all
- Defined in:
- app/components/trek/menu_component.rb
Defined Under Namespace
Classes: ItemComponent
Instance Method Summary
collapse
#stimulus_action, #stimulus_class, #stimulus_class_hash, #stimulus_class_key, #stimulus_target, #stimulus_target_hash, #stimulus_target_key, #stimulus_value, #stimulus_value_hash, #stimulus_value_key
#class_for, #class_names_for, #root_class
#identifier
Instance Method Details
#call ⇒ Object
35
36
37
38
39
40
|
# File 'app/components/trek/menu_component.rb', line 35
def call
tag.div(
safe_join([rendered_title, rendered_items].compact),
class: root_class
)
end
|
#render? ⇒ Boolean
31
32
33
|
# File 'app/components/trek/menu_component.rb', line 31
def render?
items.any?(&:render?)
end
|
#rendered_items ⇒ Object
49
50
51
52
53
54
|
# File 'app/components/trek/menu_component.rb', line 49
def rendered_items
tag.ul(
safe_join(items),
class: class_for("items")
)
end
|
#rendered_title ⇒ Object
42
43
44
45
46
47
|
# File 'app/components/trek/menu_component.rb', line 42
def rendered_title
tag.div(
title,
class: class_for("title")
)
end
|