Class: Brainzlab::Components::Alert
- Defined in:
- lib/brainzlab/components/alert.rb
Constant Summary collapse
- TYPES =
{ success: 'alert-success', error: 'alert-error', warning: 'alert-warning', info: 'alert-info' }.freeze
Instance Method Summary collapse
-
#initialize(type: :info, **attrs) ⇒ Alert
constructor
A new instance of Alert.
- #view_template ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(type: :info, **attrs) ⇒ Alert
Returns a new instance of Alert.
13 14 15 16 |
# File 'lib/brainzlab/components/alert.rb', line 13 def initialize(type: :info, **attrs) @type = type @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
18 19 20 |
# File 'lib/brainzlab/components/alert.rb', line 18 def view_template(&) div(class: alert_classes, role: 'alert', **@attrs, &) end |