Class: Tarquinn::RequestHandlerBuilder Private
- Inherits:
-
Object
- Object
- Tarquinn::RequestHandlerBuilder
- Defined in:
- lib/tarquinn/request_handler_builder.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.
Redirections rules builder
Instance Method Summary collapse
-
#add_redirection_config(redirection, *methods, &block) ⇒ Array<Tarquinn::Condition>
private
Creates a redirection rule.
-
#add_skip_action(redirection, *actions) ⇒ Array<Tarquinn::Condition>
private
Attaches a condition to skip a redirection based on route (controller action).
-
#add_skip_config(redirection, *methods, block) ⇒ Array
private
Attaches conditions to skip a redirection.
-
#build(controller) ⇒ Tarquinn::RequestHandler
private
Builds a new engine to process a request.
Instance Method Details
#add_redirection_config(redirection, *methods, &block) ⇒ Array<Tarquinn::Condition>
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.
Creates a redirection rule
The rule name defines which method will be called when checking the path of redirection
20 21 22 |
# File 'lib/tarquinn/request_handler_builder.rb', line 20 def add_redirection_config(redirection, *methods, &block) config_for(redirection).add_redirection_rules(*methods, &block) end |
#add_skip_action(redirection, *actions) ⇒ Array<Tarquinn::Condition>
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.
Attaches a condition to skip a redirection based on route (controller action)
When any of the skip rules is met the redirection is skipped
32 33 34 |
# File 'lib/tarquinn/request_handler_builder.rb', line 32 def add_skip_action(redirection, *actions) config_for(redirection).add_skip_action(*actions) end |
#add_skip_config(redirection, *methods, block) ⇒ Array
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.
Attaches conditions to skip a redirection
Methods and blocks are ran and if any returns true, the redirec is skipped
44 45 46 |
# File 'lib/tarquinn/request_handler_builder.rb', line 44 def add_skip_config(redirection, *methods, block) config_for(redirection).add_skip_rules(*methods, &block) end |
#build(controller) ⇒ Tarquinn::RequestHandler
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.
Builds a new engine to process a request
53 54 55 56 |
# File 'lib/tarquinn/request_handler_builder.rb', line 53 def build(controller) controller = Tarquinn::Controller.new(controller) Tarquinn::RequestHandler.new(configs, controller) end |