Class: FoxTail::AlertComponent
- Inherits:
-
DismissibleComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- DismissibleComponent
- FoxTail::AlertComponent
- Defined in:
- app/components/fox_tail/alert_component.rb
Constant Summary collapse
- SEVERITY_ICONS =
{ success: "check-circle", warning: "exclamation-triangle", error: "exclamation-circle" }.freeze
- DEFAULT_SEVERITY_ICON =
"information-circle"
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Attributes inherited from BaseComponent
Instance Method Summary collapse
Methods inherited from DismissibleComponent
#before_render, #call, stimulus_controller_name, #stimulus_controller_options
Methods inherited from BaseComponent
classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
Constructor Details
This class inherits a constructor from FoxTail::BaseComponent
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'app/components/fox_tail/alert_component.rb', line 7 def id @id end |
Instance Method Details
#border ⇒ Object
65 66 67 68 69 70 71 72 73 |
# File 'app/components/fox_tail/alert_component.rb', line 65 def border if [:border].is_a?(TrueClass) :basic elsif ![:border] :none else ([:border] || :none).to_sym end end |
#border? ⇒ Boolean
61 62 63 |
# File 'app/components/fox_tail/alert_component.rb', line 61 def border? border != :none end |
#use_stimulus? ⇒ Boolean
75 76 77 |
# File 'app/components/fox_tail/alert_component.rb', line 75 def use_stimulus? super && dismissible? end |