Module: SimpleCov::ArrayMergeHelper

### Home Classes Methods

### In Files

- lib/simplecov/merge_helpers.rb

### Methods

- #merge_resultset

### Class/Module Index

Quicksearch

- SimpleCov
- SimpleCov::ArrayFilter
- SimpleCov::ArrayMergeHelper
- SimpleCov::BlockFilter
- SimpleCov::CommandGuesser
- SimpleCov::Configuration
- SimpleCov::ExitCodes
- SimpleCov::FileList
- SimpleCov::Filter
- SimpleCov::Formatter
- SimpleCov::Formatter::MultiFormatter
- SimpleCov::Formatter::SimpleFormatter
- SimpleCov::HashMergeHelper
- SimpleCov::LastRun
- SimpleCov::Profiles
- SimpleCov::Railtie
- SimpleCov::Result
- SimpleCov::ResultMerger
- SimpleCov::SourceFile
- SimpleCov::SourceFile::Line
- SimpleCov::StringFilter
- SimpleCov::VERSION
- Coverage

No matching classes.

# SimpleCov::ArrayMergeHelper

### Public Instance Methods

merge_resultset(array) click to toggle source

Merges an array of coverage results with self

    # File lib/simplecov/merge_helpers.rb, line 4
    def merge_resultset(array)
      new_array = dup
      array.each_with_index do |element, i|
        if element.nil? && new_array[i].nil?
          new_array[i] = nil
        else
          local_value = element || 0
          other_value = new_array[i] || 0
          new_array[i] = local_value + other_value
        end
      end
      new_array
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.