Class: Para::Markup::Alert
- Defined in:
- lib/para/markup/alert.rb
Instance Attribute Summary
Attributes inherited from Component
Instance Method Summary collapse
Methods inherited from Component
Constructor Details
This class inherits a constructor from Para::Markup::Component
Instance Method Details
#container(message, options = {}, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/para/markup/alert.rb', line 4 def container(, = {}, &block) if block = = capture { block.call } end type = .delete(:type) || 'info' merge_class!(, "alert") merge_class!(, "alert-#{ type }") dismissable = !.key?(:dismissable) || .delete(:dismissable) merge_class!(, "alert-dismissable") if dismissable content_tag :div, do if dismissable + else end end end |