Class: Bs5::AccordionComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Bs5::AccordionComponent
- Includes:
- ComponentsHelper, ViewComponent::SlotableV2
- Defined in:
- app/components/bs5/accordion_component.rb
Defined Under Namespace
Classes: ItemComponent
Constant Summary
Constants included from ComponentsHelper
Instance Method Summary collapse
- #component_class ⇒ Object
- #flush? ⇒ Boolean
- #id ⇒ Object
-
#initialize(flush: false) ⇒ AccordionComponent
constructor
A new instance of AccordionComponent.
Methods included from ComponentsHelper
#bs5_collapse, #bs5_popover, #bs5_tooltip
Constructor Details
#initialize(flush: false) ⇒ AccordionComponent
Returns a new instance of AccordionComponent.
10 11 12 |
# File 'app/components/bs5/accordion_component.rb', line 10 def initialize(flush: false) @flush = flush end |
Instance Method Details
#component_class ⇒ Object
22 23 24 25 26 |
# File 'app/components/bs5/accordion_component.rb', line 22 def component_class class_names = ['accordion'] class_names << %w[accordion-flush] if flush? class_names.join(' ') end |
#flush? ⇒ Boolean
14 15 16 |
# File 'app/components/bs5/accordion_component.rb', line 14 def flush? @flush end |
#id ⇒ Object
18 19 20 |
# File 'app/components/bs5/accordion_component.rb', line 18 def id "accordion-#{object_id}" end |