Sha256: 92624083fdbdcf248119418bb494741154b9798bbba842ad410a7402a1c0ad1b

Contents?: true

Size: 871 Bytes

Versions: 6

Compression:

Stored size: 871 Bytes

Contents

# encoding: utf-8
module Sinatra
  module AlertHelper
    extend Hexacta

    def success_alert(option_hash)
      slim "#{Hexacta::GEM_FILE_DIR}/alerts/success".to_sym, locals: option_hash
    end

    def info_alert(option_hash)
      slim "#{Hexacta::GEM_FILE_DIR}/alerts/info".to_sym, locals: option_hash
    end

    def empty_alert(option_hash)
      slim "#{Hexacta::GEM_FILE_DIR}/alerts/empty".to_sym, locals: option_hash
    end

    def warning_alert(option_hash)
      slim "#{Hexacta::GEM_FILE_DIR}/alerts/warning".to_sym, locals: option_hash
    end

    def error_alert(option_hash)
      slim "#{Hexacta::GEM_FILE_DIR}/alerts/error".to_sym, locals: option_hash
    end

    setup_dir("/app/views/#{Hexacta::GEM_FILE_DIR}/alerts")
    copy_all_files("/lib/sinatra/views/alerts","/app/views/#{Hexacta::GEM_FILE_DIR}/alerts")
  end

  helpers AlertHelper
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sinatra-hexacta-0.8.3 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-0.8.1 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-0.8.0 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-0.7.2 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-0.7.1 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-0.7.0 lib/sinatra/helpers/alerts.rb