Class: Crystalball::ExecutionMap

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/crystalball/execution_map.rb

Overview

Storage for execution map

Defined Under Namespace

Classes: Metadata

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata: {}, example_groups: {}) ⇒ ExecutionMap

Returns a new instance of ExecutionMap.

Parameters:

  • metadata (Hash) (defaults to: {})
    • add or override metadata of execution map

  • example_groups (Hash) (defaults to: {})
    • initial list of example groups data



34
35
36
37
38
# File 'lib/crystalball/execution_map.rb', line 34

def initialize(metadata: {}, example_groups: {})
  @example_groups = example_groups

  @metadata = Metadata.new(type: self.class.name, **)
end

Instance Attribute Details

#example_groupsObject

Returns the value of attribute example_groups.



27
28
29
# File 'lib/crystalball/execution_map.rb', line 27

def example_groups
  @example_groups
end

#metadataObject

Returns the value of attribute metadata.



27
28
29
# File 'lib/crystalball/execution_map.rb', line 27

def 
  @metadata
end

Instance Method Details

#<<(example_group_map) ⇒ Object

Adds example group map to the list

Parameters:



43
44
45
# File 'lib/crystalball/execution_map.rb', line 43

def <<(example_group_map)
  example_groups[example_group_map.uid] = example_group_map.used_files.uniq
end

#clear!Object

Remove all example_groups



48
49
50
# File 'lib/crystalball/execution_map.rb', line 48

def clear!
  self.example_groups = {}
end