class RuboCop::Cop::Offense
An offense represents a style violation detected by RuboCop.
def <=>(other)
-
(Integer)
-
Other tags:
- Api: - public
def <=>(other) COMPARISON_ATTRIBUTES.each do |attribute| result = send(attribute) <=> other.send(attribute) return result unless result.zero? end 0 end
def ==(other)
-
(Boolean)
-
Other tags:
- Api: - public
def ==(other) COMPARISON_ATTRIBUTES.all? do |attribute| send(attribute) == other.send(attribute) end end
def column
- Api: - private
def column location.column end
def column_length
- Api: - private
def column_length if first_line == last_line column_range.count else source_line.length - column end end
def column_range
- Api: - private
def column_range location.column_range end
def corrected
-
(Boolean)
-
Other tags:
- Api: - public
def corrected @status == :unsupported ? false : @status == :corrected end
def disabled?
-
(Boolean)
-
Other tags:
- Api: - public
def disabled? @status == :disabled end
def first_line
- Api: - private
def first_line location.first_line end
def hash
def hash COMPARISON_ATTRIBUTES.reduce(0) do |hash, attribute| hash ^ send(attribute).hash end end
def highlighted_area
-
(Parser::Source::Range)
-
Other tags:
- Api: - public
def highlighted_area Parser::Source::Range.new(source_line, column, column + column_length) end
def initialize(severity, location, message, cop_name,
- Api: - private
def initialize(severity, location, message, cop_name, status = :uncorrected) @severity = RuboCop::Cop::Severity.new(severity) @location = location @message = message.freeze @cop_name = cop_name.freeze @status = status freeze end
def last_line
- Api: - private
def last_line location.last_line end
def line
- Api: - private
def line location.line end
def real_column
- Api: - private
def real_column column + 1 end
def source_line
- Api: - private
def source_line location.source_line end
def to_s
- Api: - private
def to_s format('%s:%3d:%3d: %s', severity.code, line, real_column, message) end