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 = public_send(attribute) <=> other.public_send(attribute) return result unless result.zero? end 0 end
def ==(other)
-
(Boolean)
-
Other tags:
- Api: - public
def ==(other) COMPARISON_ATTRIBUTES.all? do |attribute| public_send(attribute) == other.public_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 correctable?
-
(Boolean)
-
Other tags:
- Api: - public
def correctable? @status != :unsupported end
def corrected?
-
(Boolean)
-
Other tags:
- Api: - public
def corrected? @status == :corrected || @status == :corrected_with_todo end
def corrected_with_todo?
-
(Boolean)
-
Other tags:
- Api: - public
def corrected_with_todo? @status == :corrected_with_todo end
def disabled?
-
(Boolean)
-
Other tags:
- Api: - public
def disabled? @status == :disabled || @status == :todo end
def first_line
- Api: - private
def first_line location.first_line end
def hash
def hash COMPARISON_ATTRIBUTES.map { |attribute| public_send(attribute) }.hash 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, # rubocop:disable Metrics/ParameterLists
- Api: - private
def initialize(severity, location, message, cop_name, # rubocop:disable Metrics/ParameterLists status = :uncorrected, corrector = nil) @severity = RuboCop::Cop::Severity.new(severity) @location = location @message = message.freeze @cop_name = cop_name.freeze @status = status @corrector = corrector freeze end
def last_column
- Api: - private
def last_column location.last_column 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('%<severity>s:%3<line>d:%3<column>d: %<message>s', severity: severity.code, line: line, column: real_column, message: message) end