Module: DeepCover::Node::Mixin::HasTracker

Defined in:
lib/deep_cover/node/mixin/has_tracker.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

TRACKERS =
{}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
# File 'lib/deep_cover/node/mixin/has_tracker.rb', line 6

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#initializeObject



11
12
13
14
# File 'lib/deep_cover/node/mixin/has_tracker.rb', line 11

def initialize(*)
  @tracker_offset = covered_code.allocate_trackers(self.class::TRACKERS.size).begin
  super
end

#tracker_sourcesObject



16
17
18
19
20
# File 'lib/deep_cover/node/mixin/has_tracker.rb', line 16

def tracker_sources
  self.class::TRACKERS.map do |name, _|
    [:"#{name}_tracker", send(:"#{name}_tracker_source")]
  end.to_h
end