free_mutant/lib/mutant/reporter.rb
Markus Schirp 90fade2ca5 Drastically simplify reporter public interface
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)
2013-04-20 20:47:07 +02:00

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