Class: Railsboot::FlashComponent
- Inherits:
-
Component
- Object
- Component
- Railsboot::FlashComponent
- Defined in:
- app/components/railsboot/flash_component.rb
Constant Summary collapse
- FLASH_TYPES =
[:notice, :alert, :info].freeze
- FLASH_MAPPING =
{ notice: "success", alert: "danger", info: "info" }.freeze
Instance Method Summary collapse
-
#initialize(flash:, **html_attributes) ⇒ FlashComponent
constructor
A new instance of FlashComponent.
- #render? ⇒ Boolean
Constructor Details
#initialize(flash:, **html_attributes) ⇒ FlashComponent
Returns a new instance of FlashComponent.
9 10 11 12 |
# File 'app/components/railsboot/flash_component.rb', line 9 def initialize(flash:, **html_attributes) @flash = flash @html_attributes = html_attributes end |
Instance Method Details
#render? ⇒ Boolean
14 15 16 |
# File 'app/components/railsboot/flash_component.rb', line 14 def render? @flash.present? end |