Class: UiHelpers::Flash
- Defined in:
- lib/ui_helpers/elements/flash.rb
Instance Attribute Summary collapse
-
#icon ⇒ Object
Returns the value of attribute icon.
Attributes inherited from Widget
Attributes inherited from Element
Instance Method Summary collapse
Methods inherited from Element
#capture, #classes, #classes=, #initialize, #style=, #tag, #with_html_options
Constructor Details
This class inherits a constructor from UiHelpers::Element
Instance Attribute Details
#icon ⇒ Object
Returns the value of attribute icon.
4 5 6 |
# File 'lib/ui_helpers/elements/flash.rb', line 4 def icon @icon end |
Instance Method Details
#html(tag_name, &block) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/ui_helpers/elements/flash.rb', line 6 def html(tag_name, &block) tag(tag_name) do |buffer| buffer << Element.new(@template).tag(:p) do |paragraph| paragraph << Icon.new(@template, icon).tag(:span) yield paragraph if block_given? end end end |