Class: Tarquinn::Condition Abstract Private
- Inherits:
-
Object
- Object
- Tarquinn::Condition
- Defined in:
- lib/tarquinn/condition.rb,
lib/tarquinn/condition/proc_runner.rb,
lib/tarquinn/condition/method_caller.rb,
lib/tarquinn/condition/action_checker.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 condition
Direct Known Subclasses
Defined Under Namespace
Classes: ActionChecker, MethodCaller, ProcRunner
Class Method Summary collapse
-
.action_checker(routes) ⇒ Tarquinn::Condition::ActionChecker
private
Creates an action checker condition.
-
.method_caller(methods) ⇒ Tarquinn::Condition::MethodCaller, NilClass
private
Creates a method caller condition.
-
.proc_runner(&block) ⇒ Tarquinn::Condition::ProcRunner, NilClass
private
Cretes a proc checker.
Instance Method Summary collapse
-
#check?(_controller) ⇒ TrueClass, FalseClass
private
Checks if a condition is matched.
Class Method Details
.action_checker(routes) ⇒ Tarquinn::Condition::ActionChecker
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 an action checker condition
31 32 33 |
# File 'lib/tarquinn/condition.rb', line 31 def action_checker(routes) Tarquinn::Condition::ActionChecker.new(routes) end |
.method_caller(methods) ⇒ Tarquinn::Condition::MethodCaller, NilClass
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 method caller condition
20 21 22 23 24 |
# File 'lib/tarquinn/condition.rb', line 20 def method_caller(methods) return if methods.empty? Tarquinn::Condition::MethodCaller.new(methods) end |
.proc_runner(&block) ⇒ Tarquinn::Condition::ProcRunner, NilClass
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.
Cretes a proc checker
41 42 43 44 45 |
# File 'lib/tarquinn/condition.rb', line 41 def proc_runner(&block) return unless block Tarquinn::Condition::ProcRunner.new(&block) end |
Instance Method Details
#check?(_controller) ⇒ 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 a condition is matched
54 55 56 |
# File 'lib/tarquinn/condition.rb', line 54 def check?(_controller) raise NotImplementedError, 'Needs to be implemented in child class' end |