Module: Rexception

Defined in:
lib/rexception.rb,
lib/rexception/railtie.rb,
lib/rexception/version.rb,
lib/rexception/exceptions_controller.rb

Defined Under Namespace

Classes: ExceptionsController, Railtie

Constant Summary collapse

VERSION =
'0.1.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.errors_dirString

Directory name where you place error pages.

Returns:

  • (String)


16
17
18
# File 'lib/rexception.rb', line 16

def errors_dir
  @errors_dir
end

.layoutString

Layout file name to use for rendering error page.

Returns:

  • (String)


11
12
13
# File 'lib/rexception.rb', line 11

def layout
  @layout
end

Class Method Details

.configure { ... } ⇒ Object

Configuring module attributes by initializer.

Yields:

  • Rexception



28
29
30
# File 'lib/rexception.rb', line 28

def configure
  yield self
end

.rescue_responses=(rescue_responses) ⇒ Hash{String => Symbol}

Pairs of custom exceptions and statuses.

Returns:

  • (Hash{String => Symbol})


21
22
23
# File 'lib/rexception.rb', line 21

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