Module: Spurs::Flash

Defined in:
lib/spurs/flash.rb,
lib/spurs/flash/helper.rb,
lib/spurs/flash/builder.rb,
lib/spurs/flash/controller_mods.rb

Defined Under Namespace

Modules: ControllerMods, Helper Classes: Builder

Constant Summary collapse

@@flavors =

Flavors of flash message that we know how to deal with

[:error, :notice, :info, :warning]
@@flavor_titles =
{
    :error   => I18n.t(:error, :default => "error").titlecase,
    :notice  => I18n.t(:notice, :default => "notice").titlecase,
    :info    => I18n.t(:info, :default => "info").titlecase,
    :warning => I18n.t(:warning, :default => "warning").titlecase
}
@@flavor_icons =
{
    :error   => "spurs/icons/16x16/delete.png",
    :notice  => "spurs/icons/16x16/accept.png",
    :info    => "spurs/icons/16x16/info.png",
    :warning => "spurs/icons/16x16/warning.png"
}
@@default_args =
{
    :dynamic => {
        :block        => true,
        :flavor       => :info,
        :lifetime     => 5000,
        :close_button => true
    },
    :default => {
        :block        => true,
        :flavor       => :info,
        :lifetime     => -1,
        :close_button => true
    }
}

Class Method Summary collapse

Class Method Details

.default_argsObject



42
43
44
# File 'lib/spurs/flash.rb', line 42

def self.default_args
  @@default_args
end

.flavor_iconsObject



19
20
21
# File 'lib/spurs/flash.rb', line 19

def self.flavor_icons
  @@flavor_icons
end

.flavor_titlesObject



23
24
25
# File 'lib/spurs/flash.rb', line 23

def self.flavor_titles
  @@flavor_titles
end

.flavorsObject



46
47
48
# File 'lib/spurs/flash.rb', line 46

def self.flavors
  @@flavors
end