Class: DeepCover::Analyser::CoveredCodeSource
- Inherits:
-
DeepCover::Analyser
- Object
- DeepCover::Analyser
- DeepCover::Analyser::CoveredCodeSource
- Defined in:
- lib/deep_cover/analyser/covered_code_source.rb
Instance Attribute Summary collapse
-
#covered_code ⇒ Object
readonly
Returns the value of attribute covered_code.
Attributes included from Base
Instance Method Summary collapse
-
#initialize(covered_code) ⇒ CoveredCodeSource
constructor
A new instance of CoveredCodeSource.
-
#node_children(node) ⇒ Object
Looking exclusively at our subset of nodes, returns the node’s direct descendants.
-
#node_runs(node) ⇒ Object
Returns the number of runs of the node (assumed to be in our subset).
Methods included from Base
#each_node, #node_covered?, #node_runs_map, #node_stat_contributions, #node_stat_type, #results, #stats
Methods included from Tools::Covered
Constructor Details
#initialize(covered_code) ⇒ CoveredCodeSource
Returns a new instance of CoveredCodeSource.
7 8 9 |
# File 'lib/deep_cover/analyser/covered_code_source.rb', line 7 def initialize(covered_code) @covered_code = covered_code.freeze end |
Instance Attribute Details
#covered_code ⇒ Object (readonly)
Returns the value of attribute covered_code.
5 6 7 |
# File 'lib/deep_cover/analyser/covered_code_source.rb', line 5 def covered_code @covered_code end |
Instance Method Details
#node_children(node) ⇒ Object
Looking exclusively at our subset of nodes, returns the node’s direct descendants
12 13 14 |
# File 'lib/deep_cover/analyser/covered_code_source.rb', line 12 def node_children(node) node.children_nodes end |
#node_runs(node) ⇒ Object
Returns the number of runs of the node (assumed to be in our subset)
17 18 19 |
# File 'lib/deep_cover/analyser/covered_code_source.rb', line 17 def node_runs(node) node.execution_count if node.executable? end |