Sha256: 39854005536c58c2dcd076069cc37e3c56fd6ea05c013c3cf139858ab70710d2

Contents?: true

Size: 743 Bytes

Versions: 4

Compression:

Stored size: 743 Bytes

Contents

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

    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")
    symlink_all("/lib/sinatra/views/alerts","/app/views/#{Hexacta::GEM_FILE_DIR}/alerts")
  end

  helpers AlertHelper
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sinatra-hexacta-0.3.1 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-0.3.0 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-0.1.1 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-0.1.0 lib/sinatra/helpers/alerts.rb