Class: Slimembedcop::TemplateCorrector

Inherits:
Object
  • Object
show all
Defined in:
lib/slimembedcop/template_corrector.rb

Overview

Apply auto-corrections to Template file.

Instance Method Summary collapse

Constructor Details

#initialize(path, offenses, source) ⇒ TemplateCorrector

Returns a new instance of TemplateCorrector.



9
10
11
12
13
# File 'lib/slimembedcop/template_corrector.rb', line 9

def initialize(path, offenses, source)
  @path = path
  @offenses = offenses
  @source = source
end

Instance Method Details

#runObject



15
16
17
# File 'lib/slimembedcop/template_corrector.rb', line 15

def run
  ::RuboCop::Cop::Legacy::Corrector.new(source_buffer, corrections).rewrite
end