class Covered::Statistics::Aggregate

Aggregate coverage totals.

def << coverage

@parameter coverage [Covered::Coverage] The coverage object to add.
Add coverage to these aggregate statistics.
def << coverage
	@count += 1
	
	@executable_count += coverage.executable_count
	@executed_count += coverage.executed_count
end

def as_json

@returns [Hash] The aggregate count, line counts and percentage.
A JSON-compatible representation of these aggregate statistics.
def as_json
	{
		count: count,
		executable_count: executable_count,
		executed_count: executed_count,
		percentage: percentage.to_f.round(2),
	}
end

def initialize

Initialize empty aggregate statistics.
def initialize
	@count = 0
	@executable_count = 0
	@executed_count = 0
end

def to_json(options)

@returns [String] The JSON representation.
@parameter options [Hash] Options forwarded to `to_json`.
Convert these aggregate statistics to JSON.
def to_json(options)
	as_json.to_json(options)
end