Class: Ffp::Presenter
- Inherits:
-
Object
- Object
- Ffp::Presenter
- Includes:
- ActionView::Helpers
- Defined in:
- lib/ffp/presenter.rb
Constant Summary collapse
- ALERT_TYPES =
%w(success warning info alert secondary)
Instance Method Summary collapse
- #for_foundation ⇒ Object
-
#initialize(flash) ⇒ Presenter
constructor
A new instance of Presenter.
Constructor Details
#initialize(flash) ⇒ Presenter
Returns a new instance of Presenter.
7 8 9 |
# File 'lib/ffp/presenter.rb', line 7 def initialize(flash) @flash = flash end |
Instance Method Details
#for_foundation ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/ffp/presenter.rb', line 12 def for_foundation = Array.new @flash.each do |type, | next if .blank? type = "success" if type == "notice" next unless ALERT_TYPES.include?(type) Array().each do |msg| << content_tag( :div, msg.html_safe + content_tag(:a, raw("×"), :class => 'close'), :class => css_classes_for_type(type), :'data-alert' => true ) end end .join("\n").html_safe end |