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

- (Loader) initialize(reporter)

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



97
98
99
100
101
# File 'lib/rspec/core/formatters.rb', line 97

def initialize(reporter)
  @formatters = []
  @reporter = reporter
  self.default_formatter = 'progress'
end

Instance Attribute Details

- (String) default_formatter

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



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

def default_formatter
  @default_formatter
end

- (Array) formatters (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



104
105
106
# File 'lib/rspec/core/formatters.rb', line 104

def formatters
  @formatters
end

- (Reporter) reporter (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



107
108
109
# File 'lib/rspec/core/formatters.rb', line 107

def reporter
  @reporter
end

Class Method Details

+ (void) formatters

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



92
93
94
# File 'lib/rspec/core/formatters.rb', line 92

def self.formatters
  @formatters ||= {}
end