90fade2ca5
The new one is simply: Mutant::Reporter#report(object) Where object is one of: Mutant::Subject Mutant::Mutation Mutant::Config Mutant::Runner::Config (final and stats report)
28 lines
477 B
Ruby
28 lines
477 B
Ruby
module Mutant
|
|
# Abstract reporter
|
|
class Reporter
|
|
include Adamantium::Flat, AbstractType
|
|
|
|
ACTIONS = {
|
|
Subject => :subject,
|
|
}.freeze
|
|
|
|
# Report object
|
|
#
|
|
# @param [Object] object
|
|
#
|
|
# @return [self]
|
|
#
|
|
# @api private
|
|
#
|
|
def report(object)
|
|
klass = object.class
|
|
method = self.class::ACTIONS.fetch(klass) do
|
|
raise "No reporter for: #{klass}"
|
|
end
|
|
send(method, object)
|
|
self
|
|
end
|
|
|
|
end
|
|
end
|