Module: top_level_module::DeepCover::GlobalVariables

Defined in:
lib/deep_cover/global_variables.rb

Class Method Summary collapse

Class Method Details

.path_per_index(global_name = nil) ⇒ Object



18
19
20
21
22
# File 'lib/deep_cover/global_variables.rb', line 18

def self.path_per_index(global_name = nil)
  @path_per_index ||= {}
  global_name ||= DeepCover.config.tracker_global
  @path_per_index[global_name] ||= eval("#{global_name}_p ||= {}") # rubocop:disable Security/Eval
end

.tracker_hits_per_path(global_name = nil) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/deep_cover/global_variables.rb', line 24

def self.tracker_hits_per_path(global_name = nil)
  cur_trackers = self.trackers(global_name)
  hits_per_path = path_per_index(global_name).map do |index, path|
    [path, cur_trackers[index]]
  end
  hits_per_path.to_h
end

.trackers(global_name = nil) ⇒ Object



12
13
14
15
16
# File 'lib/deep_cover/global_variables.rb', line 12

def self.trackers(global_name = nil)
  @trackers ||= {}
  global_name ||= DeepCover.config.tracker_global
  @trackers[global_name] ||= eval("#{global_name} ||= {}") # rubocop:disable Security/Eval
end