Class: Tarquinn::RedirectionConfig Private
- Inherits:
-
Object
- Object
- Tarquinn::RedirectionConfig
- Defined in:
- lib/tarquinn/redirection_config.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.
Redirection configuration
Instance Attribute Summary collapse
- #redirect ⇒ Object readonly private
Instance Method Summary collapse
-
#add_redirection_rules(*methods, &block) ⇒ Array<Tarquinn::Condition>
private
Adds conditions to the rule.
-
#add_skip_action(*actions) ⇒ Array<Tarquinn::Condition>
private
Add rule for skipping on some actions / routes.
-
#add_skip_rules(*methods, &block) ⇒ Array
private
Attaches conditions to skip a redirection.
-
#initialize(redirect) ⇒ RedirectionConfig
constructor
private
A new instance of RedirectionConfig.
-
#redirection_blocks ⇒ Array<Tarquinn::Condition>
private
All blocks that indicate a redirection.
-
#skip_blocks ⇒ Array<Tarquinn::Condition>
private
All blocks that indicate a redirection should be skipped.
Constructor Details
#initialize(redirect) ⇒ RedirectionConfig
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 RedirectionConfig.
13 14 15 |
# File 'lib/tarquinn/redirection_config.rb', line 13 def initialize(redirect) @redirect = redirect end |
Instance Attribute Details
#redirect ⇒ Object (readonly)
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.
10 11 12 |
# File 'lib/tarquinn/redirection_config.rb', line 10 def redirect @redirect end |
Instance Method Details
#add_redirection_rules(*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.
Adds conditions to the rule
The rule name defines which method will be called when checking the path of redirection
25 26 27 28 |
# File 'lib/tarquinn/redirection_config.rb', line 25 def add_redirection_rules(*methods, &block) redirect_on method_caller(methods) redirect_on proc_runner(&block) end |
#add_skip_action(*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.
Add rule for skipping on some actions / routes
35 36 37 |
# File 'lib/tarquinn/redirection_config.rb', line 35 def add_skip_action(*actions) skip action_checker(actions) end |
#add_skip_rules(*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
47 48 49 50 |
# File 'lib/tarquinn/redirection_config.rb', line 47 def add_skip_rules(*methods, &block) skip method_caller(methods) skip proc_runner(&block) end |
#redirection_blocks ⇒ 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.
All blocks that indicate a redirection
55 56 57 |
# File 'lib/tarquinn/redirection_config.rb', line 55 def redirection_blocks @redirection_blocks ||= [] end |
#skip_blocks ⇒ 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.
All blocks that indicate a redirection should be skipped
62 63 64 |
# File 'lib/tarquinn/redirection_config.rb', line 62 def skip_blocks @skip_blocks ||= [] end |