Class: Minitest::Subjective::FileResult::BranchStatistics::ConditionalHits
- Inherits:
-
Struct
- Object
- Struct
- Minitest::Subjective::FileResult::BranchStatistics::ConditionalHits
- Extended by:
- Forwardable
- Defined in:
- lib/minitest/subjective/file_result/branch_statistics/conditional_hits.rb
Instance Attribute Summary collapse
-
#branches ⇒ Object
Returns the value of attribute branches.
-
#id ⇒ Object
Returns the value of attribute id.
-
#label ⇒ Object
Returns the value of attribute label.
-
#range ⇒ Object
Returns the value of attribute range.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#branches ⇒ Object
Returns the value of attribute branches
7 8 9 |
# File 'lib/minitest/subjective/file_result/branch_statistics/conditional_hits.rb', line 7 def branches @branches end |
#id ⇒ Object
Returns the value of attribute id
7 8 9 |
# File 'lib/minitest/subjective/file_result/branch_statistics/conditional_hits.rb', line 7 def id @id end |
#label ⇒ Object
Returns the value of attribute label
7 8 9 |
# File 'lib/minitest/subjective/file_result/branch_statistics/conditional_hits.rb', line 7 def label @label end |
#range ⇒ Object
Returns the value of attribute range
7 8 9 |
# File 'lib/minitest/subjective/file_result/branch_statistics/conditional_hits.rb', line 7 def range @range end |
Class Method Details
.from_pair(key, branches) ⇒ Object
12 13 14 15 |
# File 'lib/minitest/subjective/file_result/branch_statistics/conditional_hits.rb', line 12 def self.from_pair(key, branches) label, id, *range = key new(label:, id:, range: Range.from_array(range), branches: branches.collect { BranchHits.from_pair(*_1) }) end |
Instance Method Details
#+(other) ⇒ Object
17 18 19 20 21 |
# File 'lib/minitest/subjective/file_result/branch_statistics/conditional_hits.rb', line 17 def +(other) return self unless matches?(other) self.class.new(label, id, range, branches.zip(other.branches).collect { |current, new| current + new }) end |
#-(other) ⇒ Object
23 24 25 26 27 |
# File 'lib/minitest/subjective/file_result/branch_statistics/conditional_hits.rb', line 23 def -(other) return self unless matches?(other) self.class.new(label, id, range, branches.zip(other.branches).collect { |current, new| current - new }) end |
#covered? ⇒ Boolean
29 30 31 |
# File 'lib/minitest/subjective/file_result/branch_statistics/conditional_hits.rb', line 29 def covered? branches.all?(&:covered?) end |