Class: Mutant::Reporter::CLI::Printer

Inherits:
Object
  • Object
show all
Includes:
AbstractType, Adamantium::Flat
Defined in:
lib/mutant/reporter/cli/printer.rb,
lib/mutant/reporter/cli/printer/config.rb,
lib/mutant/reporter/cli/printer/killer.rb,
lib/mutant/reporter/cli/printer/subject.rb,
lib/mutant/reporter/cli/printer/mutation.rb

Overview

CLI runner status printer base class

Direct Known Subclasses

Config, Killer, Mutation, Subject

Defined Under Namespace

Classes: Config, Killer, Mutation, Subject

Constant Summary collapse

REGISTRY =
{}

Class Method Summary collapse

Class Method Details

.build(*args) ⇒ Printer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Build printer

Returns:



41
42
43
# File 'lib/mutant/reporter/cli/printer.rb', line 41

def self.build(*args)
  new(*args)
end

.finalizeundefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Finalize CLI reporter

Returns:

  • (undefined)


31
32
33
# File 'lib/mutant/reporter/cli/printer.rb', line 31

def self.finalize
  REGISTRY.freeze
end

.handle(klass) ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Registre handler for class

Parameters:

  • klass (Class)

Returns:

  • (undefined)


21
22
23
# File 'lib/mutant/reporter/cli/printer.rb', line 21

def self.handle(klass)
  REGISTRY[klass] = self
end

.run(*args) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Run printer

Returns:

  • (self)


51
52
53
54
# File 'lib/mutant/reporter/cli/printer.rb', line 51

def self.run(*args)
  build(*args).run
  self
end

.visit(object, output) ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Visit object

Parameters:

  • object (Object)
  • output (IO)

Returns:

  • (undefined)


65
66
67
68
# File 'lib/mutant/reporter/cli/printer.rb', line 65

def self.visit(object, output)
  printer = lookup(object.class)
  printer.run(object, output)
end