Module: Tarquinn

Extended by:
ActiveSupport::Concern
Defined in:
lib/tarquinn.rb,
lib/tarquinn/version.rb,
lib/tarquinn/condition.rb,
lib/tarquinn/controller.rb,
lib/tarquinn/class_methods.rb,
lib/tarquinn/request_handler.rb,
lib/tarquinn/redirection_config.rb,
lib/tarquinn/redirection_handler.rb,
lib/tarquinn/condition/proc_runner.rb,
lib/tarquinn/condition/method_caller.rb,
lib/tarquinn/request_handler_builder.rb,
lib/tarquinn/condition/action_checker.rb

Overview

Concern adding methods for easy redirection controll

Defined Under Namespace

Modules: ClassMethods Classes: Condition, Controller, RedirectionConfig, RedirectionHandler, RequestHandler, RequestHandlerBuilder

Constant Summary collapse

VERSION =
'0.3.0'

Class Method Summary collapse

Class Method Details

.redirection_rule(redirection, *methods, &block) ⇒ Array<Tarquinn::Condition>

Creates a redirection rule

The rule name defines which method will be called when checking the path of redirection

Parameters:

  • redirection (Symbol)

    Rule name and method with redirection path

  • methods (Array<Symbol>)

    Methods that tell that a redirection should be applied

  • block (Proc)

    block that tells if a the redirection should be applied

Returns:



# File 'lib/tarquinn.rb', line 22

.redirector_builderRequestHandlerBuilder

Retruns the RequestHandlerBuilder

RequestHandlerBuilder will Carry all the configurations and will create one RequestHandler for each request



57
58
59
# File 'lib/tarquinn.rb', line 57

included do
  before_action :perform_redirection
end

.skip_redirection(redirection, *actions) ⇒ Array<Tarquinn::Condition>

Attaches a condition to skip a redirection based on route (controller action)

When any of the skip rules is met the redirection is skipped

Parameters:

  • redirection (Symbol)

    Rule name to attach the skip condition

  • actions (Array<Symbol>)

    actions / routes to be skipped by redirection rule

Returns:



# File 'lib/tarquinn.rb', line 31

.skip_redirection_rule(redirection, *methods, &block) ⇒ Array<Tarquinn::Condition>

Attaches conditions to skip a redirection

Methods and blocks are ran and if any returns true, the redirec is skipped

Parameters:

  • redirection (Symbol)

    Rule name to attach the skip condition

  • actions (Array<Symbol>)

    actions / routes to be skipped by redirection rule

Returns:



# File 'lib/tarquinn.rb', line 40