Module: HamlLint::LinterRegistry

Overview

Stores all defined linters.

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.lintersObject (readonly)

Returns the value of attribute linters


9
10
11
# File 'lib/haml_lint/linter_registry.rb', line 9

def linters
  @linters
end

Class Method Details

.extract_linters_from(linter_names) ⇒ Object


15
16
17
18
19
20
21
22
23
# File 'lib/haml_lint/linter_registry.rb', line 15

def extract_linters_from(linter_names)
  linter_names.map do |linter_name|
    begin
      HamlLint::Linter.const_get(linter_name)
    rescue NameError
      raise NoSuchLinter, "Linter #{linter_name} does not exist"
    end
  end
end

.included(base) ⇒ Object


11
12
13
# File 'lib/haml_lint/linter_registry.rb', line 11

def included(base)
  @linters << base
end