Sha256: e4cc453e4a460862814114547dab9ddf2aec63b731a70e8d90904b7ba9f173d8

Contents?: true

Size: 996 Bytes

Versions: 74

Compression:

Stored size: 996 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

    def process_alert(option_hash)
      slim "#{Hexacta::GEM_FILE_DIR}/alerts/process".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

74 entries across 74 versions & 1 rubygems

Version Path
sinatra-hexacta-1.7.20 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.19 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.18 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.17 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.16 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.15 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.14 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.13 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.12 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.11 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.10 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.9 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.8 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.7 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.6 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.5 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.4 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.3 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.2 lib/sinatra/helpers/alerts.rb
sinatra-hexacta-1.7.0 lib/sinatra/helpers/alerts.rb