class RuboCop::Cop::Corrector

def initialize(source_buffer, corrections = [])

Parameters:
  • corrections (Array(#call)) --
  • source_buffer (Parser::Source::Buffer) --
def initialize(source_buffer, corrections = [])
  @source_buffer = source_buffer
  @corrections = corrections
  @source_rewriter = Parser::Source::Rewriter.new(source_buffer)
  @diagnostics = []
  # Don't print warnings to stderr if corrections conflict with each other
  @source_rewriter.diagnostics.consumer = lambda do |diagnostic|
    @diagnostics << diagnostic
  end
end