class ERBLint::Offense

Defines common functionality available to all linters.

def ==(other)

def ==(other)
  other.class <= ERBLint::Offense &&
    other.linter == linter &&
    other.source_range == source_range &&
    other.message == message &&
    other.severity == severity
end

def column

def column
  source_range.column
end

def disabled?

def disabled?
  @disabled
end

def initialize(linter, source_range, message, context = nil, severity = nil)

def initialize(linter, source_range, message, context = nil, severity = nil)
  unless source_range.is_a?(Parser::Source::Range)
    raise ArgumentError, "expected Parser::Source::Range for arg 2"
  end
  @linter = linter
  @source_range = source_range
  @message = message
  @context = context
  @severity = severity
  @disabled = false
end

def inspect

def inspect
  "#<#{self.class.name} linter=#{linter.class.name} " \
    "source_range=#{source_range.begin_pos}...#{source_range.end_pos} " \
    "message=#{message}> " \
    "severity=#{severity}"
end

def last_column

def last_column
  source_range.last_column
end

def last_line

def last_line
  source_range.last_line
end

def length

def length
  source_range.length
end

def line_number

def line_number
  line_range.begin
end

def line_range

def line_range
  Range.new(source_range.line, source_range.last_line)
end

def simple_name

def simple_name
  linter.class.simple_name
end

def to_cached_offense_hash

def to_cached_offense_hash
  ERBLint::CachedOffense.new_from_offense(self).to_h
end