123456789_123456789_123456789_123456789_123456789_

Class: RuboCop::Cop::Offense::Correction

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Struct
Instance Chain:
self, Struct
Inherits: Struct
  • Object
Defined in: lib/rubocop/cop/offense.rb

Overview

A single edit of an autocorrection: the source range it replaces and the text it replaces it with. An insertion has an empty range, a removal an empty replacement.

Instance Attribute Summary

  • #begin_pos rw

    A single edit of an autocorrection: the source range it replaces and the text it replaces it with.

  • #end_pos rw

    A single edit of an autocorrection: the source range it replaces and the text it replaces it with.

  • #replacement rw

    A single edit of an autocorrection: the source range it replaces and the text it replaces it with.

Instance Method Summary

Instance Attribute Details

#begin_pos (rw)

A single edit of an autocorrection: the source range it replaces and the text it replaces it with. An insertion has an empty range, a removal an empty replacement.

[ GitHub ]

  
# File 'lib/rubocop/cop/offense.rb', line 129

Correction = Struct.new(:begin_pos, :end_pos, :replacement)

#end_pos (rw)

A single edit of an autocorrection: the source range it replaces and the text it replaces it with. An insertion has an empty range, a removal an empty replacement.

[ GitHub ]

  
# File 'lib/rubocop/cop/offense.rb', line 129

Correction = Struct.new(:begin_pos, :end_pos, :replacement)

#replacement (rw)

A single edit of an autocorrection: the source range it replaces and the text it replaces it with. An insertion has an empty range, a removal an empty replacement.

[ GitHub ]

  
# File 'lib/rubocop/cop/offense.rb', line 129

Correction = Struct.new(:begin_pos, :end_pos, :replacement)

Instance Method Details

#length

[ GitHub ]

  
# File 'lib/rubocop/cop/offense.rb', line 130

def length
  end_pos - begin_pos
end