Class: RSpec::Core::Formatters::Loader Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/core/formatters.rb

Overview

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

RSpec::Core::Formatters::Loader is an internal class for managing formatters used by a particular configuration. It is not expected to be used directly, but only through the configuration interface.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reporter) ⇒ Loader

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.

Returns a new instance of Loader.

103
104
105
106
107
# File 'lib/rspec/core/formatters.rb', line 103
def initialize(reporter)
  @formatters = []
  @reporter = reporter
  self.default_formatter = 'progress'
end

Instance Attribute Details

#default_formatterString

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.

Returns the default formatter to setup, defaults to progress.

Returns:

  • (String)

    the default formatter to setup, defaults to progress

116
117
118
# File 'lib/rspec/core/formatters.rb', line 116
def default_formatter
  @default_formatter
end

#formattersArray (readonly)

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.

Returns the loaded formatters.

Returns:

  • (Array)

    the loaded formatters

110
111
112
# File 'lib/rspec/core/formatters.rb', line 110
def formatters
  @formatters
end

#reporterReporter (readonly)

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.

Returns the reporter.

Returns:

113
114
115
# File 'lib/rspec/core/formatters.rb', line 113
def reporter
  @reporter
end

Class Method Details

.formattersvoid

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.

Internal formatters are stored here when loaded.

98
99
100
# File 'lib/rspec/core/formatters.rb', line 98
def self.formatters
  @formatters ||= {}
end