Class: UiHelpers::Flash

Inherits:
Widget show all
Defined in:
lib/ui_helpers/elements/flash.rb

Instance Attribute Summary collapse

Attributes inherited from Widget

#corner, #state

Attributes inherited from Element

#html_options

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

#iconObject

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