Class: Contrast::Agent::Assess::Policy::Propagator::Base
- Defined in:
- lib/contrast/agent/assess/policy/propagator/base.rb,
ext/cs__assess_yield_track/cs__assess_yield_track.c
Overview
A propagator is a method which can transform data, as described by the Contrast::Agent::Assess::Policy::PropagationNode class. Each type of propagator does so differently, but always acts on a Source to pass tags from it to a Target.
Direct Known Subclasses
Append, Buffer, Center, DatabaseWrite, Insert, Keep, MatchData, Next, Prepend, RackProtection, Remove, Replace, Response, Reverse, Splat, Split
Class Method Summary collapse
-
.find_source(source, preshift) ⇒ Object
Retrieve the source from the preshift state.
-
.propagate(_propagation_node, _preshift, _target) ⇒ Object
Propagate the tags from the source to the target.
-
.tracked_value?(value) ⇒ Boolean
Check if tags are present on the given target.
Class Method Details
.find_source(source, preshift) ⇒ Object
Retrieve the source from the preshift state.
19 20 21 22 23 24 25 26 |
# File 'lib/contrast/agent/assess/policy/propagator/base.rb', line 19 def find_source source, preshift case source when Contrast::Utils::ObjectShare::OBJECT_KEY preshift.object else preshift.args[source] end end |
.propagate(_propagation_node, _preshift, _target) ⇒ Object
Propagate the tags from the source to the target. This method should be extended by the subclasses.
40 41 42 |
# File 'lib/contrast/agent/assess/policy/propagator/base.rb', line 40 def propagate _propagation_node, _preshift, _target raise(NoMethodError("Expected Base propagator subclass: #{ cs__class } to implement #propagate")) end |