Sha256: 03819b2fa50ad8fee3bb98719bec236b18869f1005fc5dd732366811fe358752

Contents?: true

Size: 544 Bytes

Versions: 1

Compression:

Stored size: 544 Bytes

Contents

require 'singleton'

module Rexception
  class Setting
    include Singleton

    attr_accessor :layout
    attr_accessor :errors_dir

    def initialize
      defaults.each { |k, v| instance_variable_set("@#{k}", v) }
    end

    def setup
      yield self
    end

    def rescue_responses=(rescue_responses)
      ActionDispatch::ExceptionWrapper.rescue_responses.merge!(rescue_responses)
    end

    private

    def defaults
      @defaults ||= {
        layout:     'application',
        errors_dir: 'errors'
      }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rexception-0.0.1 lib/rexception/setting.rb