Class: Templatecop::TemplateCorrector
- Inherits:
-
Object
- Object
- Templatecop::TemplateCorrector
- Defined in:
- lib/templatecop/template_corrector.rb
Overview
Apply auto-corrections to Template file.
Instance Method Summary collapse
-
#call ⇒ String
Rewritten Template code.
-
#initialize(file_path:, offenses:, source:) ⇒ TemplateCorrector
constructor
A new instance of TemplateCorrector.
Constructor Details
#initialize(file_path:, offenses:, source:) ⇒ TemplateCorrector
Returns a new instance of TemplateCorrector.
12 13 14 15 16 |
# File 'lib/templatecop/template_corrector.rb', line 12 def initialize(file_path:, offenses:, source:) @file_path = file_path @offenses = offenses @source = source end |
Instance Method Details
#call ⇒ String
Returns Rewritten Template code.
19 20 21 |
# File 'lib/templatecop/template_corrector.rb', line 19 def call ::RuboCop::Cop::Legacy::Corrector.new(source_buffer, corrections).rewrite end |