Sha256: e5262e89734177c60f4e44e6924e74f5131f7bd8f306d15519e36f4a334f99af

Contents?: true

Size: 746 Bytes

Versions: 2

Compression:

Stored size: 746 Bytes

Contents

require 'bootstrap_flash_messages/helpers'
require 'bootstrap_flash_messages/flash_messages'

module BootstrapFlashMessages
  ALERT_CLASS_MAPPING = Hash.new(:info).merge(:notice => :success, :success => :success, :warning => :warning, :error => :danger).freeze
  
  def self.alert_class_mapping(key)
    ALERT_CLASS_MAPPING[key.to_sym]
  end
  
  def self.initialize
    return if @initialized
    raise "ActionController is not available yet." unless defined?(ActionController)
    ActionController::Base.send(:helper, BootstrapFlashMessages::Helpers)
    ActionController::Base.send(:include, BootstrapFlashMessages::FlashMessages)
    @initialized = true
  end
end

if defined?(Rails::Railtie)
  require 'bootstrap_flash_messages/railtie'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bootstrap_flash_messages-1.0.2 lib/bootstrap_flash_messages.rb
bootstrap_flash_messages-1.0.1 lib/bootstrap_flash_messages.rb