class HamlLint::Lint

Contains information about a problem or issue with a HAML document.

Attributes

filename[R]

@return [String] file path to which the lint applies

line[R]

@return [String] line number of the file the lint corresponds to

linter[R]

@return [SlimLint::Linter] linter that reported the lint

message[R]

@return [String] error/warning message to display to user

severity[R]

@return [Symbol] whether this lint is a warning or an error

Public Class Methods

new(linter, filename, line, message, severity = :warning) click to toggle source

Creates a new lint.

@param linter [HamlLint::Linter] @param filename [String] @param line [Fixnum] @param message [String] @param severity [Symbol]

# File lib/haml_lint/lint.rb, line 28
def initialize(linter, filename, line, message, severity = :warning)
  @linter   = linter
  @filename = filename
  @line     = line || 0
  @message  = message
  @severity = Severity.new(severity)
end

Public Instance Methods

error?() click to toggle source

Return whether this lint has a severity of error.

@return [Boolean]

# File lib/haml_lint/lint.rb, line 39
def error?
  @severity.error?
end