Class: Railsboot::AccordionComponent
- Inherits:
-
Component
- Object
- Component
- Railsboot::AccordionComponent
- Defined in:
- app/components/railsboot/accordion_component.rb
Overview
ViewComponent: renders the accordion block.
Instance Method Summary collapse
-
#initialize(flush: false, **html_attributes) ⇒ AccordionComponent
constructor
A new instance of AccordionComponent.
Constructor Details
#initialize(flush: false, **html_attributes) ⇒ AccordionComponent
Returns a new instance of AccordionComponent.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/components/railsboot/accordion_component.rb', line 6 def initialize(flush: false, **html_attributes) @flush = flush @html_attributes = html_attributes @html_attributes[:tag] = "div" @html_attributes[:class] = class_names( "accordion", { "accordion-flush" => @flush }, html_attributes.delete(:class) ) end |