Class: Tarquinn::RedirectionHandler Private
- Inherits:
-
Object
- Object
- Tarquinn::RedirectionHandler
- Defined in:
- lib/tarquinn/redirection_handler.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Redirect config handler
Checks if one redirection rule should or should not be applied
Instance Method Summary collapse
-
#initialize(config, controller) ⇒ RedirectionHandler
constructor
private
A new instance of RedirectionHandler.
-
#perform_redirect? ⇒ TrueClass, FalseClass
private
Checks if redirection should be performd.
-
#redirect ⇒ String
private
Performs redirction to a new route.
Constructor Details
#initialize(config, controller) ⇒ RedirectionHandler
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RedirectionHandler.
12 13 14 15 |
# File 'lib/tarquinn/redirection_handler.rb', line 12 def initialize(config, controller) @config = config @controller = controller end |
Instance Method Details
#perform_redirect? ⇒ TrueClass, FalseClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Checks if redirection should be performd
21 22 23 24 25 |
# File 'lib/tarquinn/redirection_handler.rb', line 21 def perform_redirect? return perform_redirect if instance_variable_defined?(:@perform_redirect) @perform_redirect = redirect? end |
#redirect ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Performs redirction to a new route
30 31 32 |
# File 'lib/tarquinn/redirection_handler.rb', line 30 def redirect controller.call(:redirect_to, redirect_path) end |