Class: Contrast::Agent::Assess::Policy::Propagator::Keep

Inherits:
Base
  • Object
show all
Defined in:
lib/contrast/agent/assess/policy/propagator/keep.rb

Overview

Propagation that results in all the tags of the source being applied to the target exactly as is. The target’s preexisting tags are unaffected beyond any merging of overlapping tags.

Class Method Summary collapse

Methods inherited from Base

find_source, tracked_value?

Class Method Details

.propagate(propagation_node, preshift, target) ⇒ Object

Keep means the tags just pass from the source to the target as is.



16
17
18
19
20
21
22
# File 'lib/contrast/agent/assess/policy/propagator/keep.rb', line 16

def propagate propagation_node, preshift, target
  properties = Contrast::Agent::Assess::Tracker.properties(target)
  return unless properties

  source = find_source(propagation_node.sources[0], preshift)
  properties.copy_from(source, target, 0, propagation_node.untags)
end