Class: DsfrComponent::SideMenuComponent::ItemComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- DsfrComponent::SideMenuComponent::ItemComponent
- Defined in:
- app/components/dsfr_component/side_menu_component/item_component.rb
Constant Summary collapse
- MAX_LEVEL =
3
Constants inherited from Base
Base::HEADING_LEVELS, Base::SIZES
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(title:, path:, current_page: false, expanded: false, level: 1, html_attributes: {}) ⇒ ItemComponent
constructor
A new instance of ItemComponent.
Constructor Details
#initialize(title:, path:, current_page: false, expanded: false, level: 1, html_attributes: {}) ⇒ ItemComponent
Returns a new instance of ItemComponent.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/components/dsfr_component/side_menu_component/item_component.rb', line 13 def initialize(title:, path:, current_page: false, expanded: false, level: 1, html_attributes: {}) raise ArgumentError, "Le menu latéral ne supporte pas plus de #{MAX_LEVEL} niveaux" if level > MAX_LEVEL @title = title @path = path @current_page = current_page = @level = level super(html_attributes: html_attributes) end |