Class: HamlLint::Lint

Inherits:
Object
  • Object
show all
Defined in:
lib/haml_lint/lint.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(linter, filename, line, message, severity = :warning) ⇒ Lint

Creates a new lint.


13
14
15
16
17
18
19
# File 'lib/haml_lint/lint.rb', line 13

def initialize(linter, filename, line, message, severity = :warning)
  @linter   = linter
  @filename = filename
  @line     = line || 0
  @message  = message
  @severity = severity
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename


4
5
6
# File 'lib/haml_lint/lint.rb', line 4

def filename
  @filename
end

#lineObject (readonly)

Returns the value of attribute line


4
5
6
# File 'lib/haml_lint/lint.rb', line 4

def line
  @line
end

#linterObject (readonly)

Returns the value of attribute linter


4
5
6
# File 'lib/haml_lint/lint.rb', line 4

def linter
  @linter
end

#messageObject (readonly)

Returns the value of attribute message


4
5
6
# File 'lib/haml_lint/lint.rb', line 4

def message
  @message
end

#severityObject (readonly)

Returns the value of attribute severity


4
5
6
# File 'lib/haml_lint/lint.rb', line 4

def severity
  @severity
end

Instance Method Details

#error?Boolean


21
22
23
# File 'lib/haml_lint/lint.rb', line 21

def error?
  @severity == :error
end