Class: Railsboot::Toast::HeaderComponent
- Inherits:
-
Component
- Object
- Component
- Railsboot::Toast::HeaderComponent
- Defined in:
- app/components/railsboot/toast/header_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**html_attributes) ⇒ HeaderComponent
constructor
A new instance of HeaderComponent.
Constructor Details
#initialize(**html_attributes) ⇒ HeaderComponent
Returns a new instance of HeaderComponent.
2 3 4 5 6 7 8 9 10 |
# File 'app/components/railsboot/toast/header_component.rb', line 2 def initialize(**html_attributes) @html_attributes = html_attributes @html_attributes[:tag] = "div" @html_attributes[:class] = class_names( "toast-header", html_attributes.delete(:class) ) end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 |
# File 'app/components/railsboot/toast/header_component.rb', line 12 def call render(Railsboot::BaseComponent.new(**@html_attributes)) do content.to_s + render(Railsboot::CloseButtonComponent.new(data: {bs_dismiss: "toast"})) end end |