Class: Noteikumi::RuleExecutionScope Private
- Inherits:
-
Object
- Object
- Noteikumi::RuleExecutionScope
- Defined in:
- lib/noteikumi/rule_execution_scope.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.
A class that exist to execute the logic of the rule
Instance Attribute Summary collapse
-
#logger ⇒ Logger
readonly
private
The active logger.
-
#rule ⇒ Rule
readonly
private
The rule being ran.
-
#state ⇒ State
readonly
private
The state the rule is processing.
Instance Method Summary collapse
-
#initialize(rule) ⇒ RuleExecutionScope
constructor
private
Creates a new scope object.
-
#run ⇒ Object
private
Runs the rule logic within this scope.
Constructor Details
#initialize(rule) ⇒ RuleExecutionScope
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 new scope object
21 22 23 24 25 |
# File 'lib/noteikumi/rule_execution_scope.rb', line 21 def initialize(rule) @rule = rule @state = rule.state @logger = rule.logger end |
Instance Attribute Details
#logger ⇒ Logger (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.
The active logger
15 16 17 |
# File 'lib/noteikumi/rule_execution_scope.rb', line 15 def logger @logger end |
#rule ⇒ Rule (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.
The rule being ran
7 8 9 |
# File 'lib/noteikumi/rule_execution_scope.rb', line 7 def rule @rule end |
#state ⇒ State (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.
The state the rule is processing
11 12 13 |
# File 'lib/noteikumi/rule_execution_scope.rb', line 11 def state @state end |
Instance Method Details
#run ⇒ Object
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.
Runs the rule logic within this scope
30 31 32 |
# File 'lib/noteikumi/rule_execution_scope.rb', line 30 def run @rule.run_logic.call end |