Class: Aldous::Respondable::Redirectable

Inherits:
Base
  • Object
show all
Defined in:
lib/aldous/respondable/redirectable.rb

Defined Under Namespace

Classes: RedirectAction

Instance Attribute Summary

Attributes inherited from Base

#view_context, #view_data

Instance Method Summary collapse

Methods inherited from Base

#build_view, #initialize, #status

Constructor Details

This class inherits a constructor from Aldous::Respondable::Base

Instance Method Details

#action(controller) ⇒ Object



7
8
9
# File 'lib/aldous/respondable/redirectable.rb', line 7

def action(controller)
  RedirectAction.new(location, controller, view_data, status)
end

#default_statusObject



15
16
17
# File 'lib/aldous/respondable/redirectable.rb', line 15

def default_status
  :found
end

#locationObject

Raises:



11
12
13
# File 'lib/aldous/respondable/redirectable.rb', line 11

def location
  raise Errors::UserError.new("Redirectable objects must define a 'location' method")
end