Method: Lookbook::BaseComponent#initialize
- Defined in:
- app/components/lookbook/base_component.rb
#initialize(alpine_data: [], **html_attrs) ⇒ BaseComponent
Returns a new instance of BaseComponent.
7 8 9 10 11 |
# File 'app/components/lookbook/base_component.rb', line 7 def initialize(alpine_data: [], **html_attrs) @alpine_data ||= alpine_data @html_attrs = html_attrs @html_attrs[:class] = {"#{@html_attrs[:class]}": true} if @html_attrs[:class].is_a? String end |