Exception: Waves::Dispatchers::Redirect

Inherits:
SignalException
  • Object
show all
Defined in:
lib/dispatchers/base.rb

Overview

Redirect exceptions are rescued by the Waves dispatcher and used to set the response status and location.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, status = '302') ⇒ Redirect

Returns a new instance of Redirect.



13
14
15
16
# File 'lib/dispatchers/base.rb', line 13

def initialize( path, status = '302' )
  @path = path
  @status = status
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



12
13
14
# File 'lib/dispatchers/base.rb', line 12

def path
  @path
end

#statusObject (readonly)

Returns the value of attribute status.



12
13
14
# File 'lib/dispatchers/base.rb', line 12

def status
  @status
end

Instance Method Details

#messageObject



17
18
19
# File 'lib/dispatchers/base.rb', line 17

def message
  "location: #{@path} status: #{@status}"
end