Class: ERBLint::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/erb_lint/reporter.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stats, autocorrect) ⇒ Reporter

Returns a new instance of Reporter.



26
27
28
29
# File 'lib/erb_lint/reporter.rb', line 26

def initialize(stats, autocorrect)
  @stats = stats
  @autocorrect = autocorrect
end

Class Method Details

.available_format?(format) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/erb_lint/reporter.rb', line 13

def self.available_format?(format)
  available_formats.include?(format.to_s)
end

.available_formatsObject



17
18
19
20
21
22
23
24
# File 'lib/erb_lint/reporter.rb', line 17

def self.available_formats
  descendants
    .map(&:to_s)
    .map(&:demodulize)
    .map(&:underscore)
    .map { |klass_name| klass_name.sub("_reporter", "") }
    .sort
end

.create_reporter(format, *args) ⇒ Object



8
9
10
11
# File 'lib/erb_lint/reporter.rb', line 8

def self.create_reporter(format, *args)
  reporter_klass = "#{ERBLint::Reporters}::#{format.to_s.camelize}Reporter".constantize
  reporter_klass.new(*args)
end

Instance Method Details

#previewObject



31
# File 'lib/erb_lint/reporter.rb', line 31

def preview; end

#showObject



33
# File 'lib/erb_lint/reporter.rb', line 33

def show; end