Class: HamlLint::CommentConfiguration
- Inherits:
-
Object
- Object
- HamlLint::CommentConfiguration
- Defined in:
- lib/haml_lint/comment_configuration.rb
Overview
Determines what linters are enabled or disabled via comments.
Instance Method Summary collapse
-
#disabled?(linter_name) ⇒ true, false
Checks whether a linter is disabled for the node.
-
#initialize(node) ⇒ CommentConfiguration
constructor
Instantiates a new CommentConfiguration.
Constructor Details
#initialize(node) ⇒ CommentConfiguration
Instantiates a new HamlLint::CommentConfiguration.
9 10 11 |
# File 'lib/haml_lint/comment_configuration.rb', line 9 def initialize(node) @directives = node.directives.reverse end |
Instance Method Details
#disabled?(linter_name) ⇒ true, false
Checks whether a linter is disabled for the node.
18 19 20 21 22 |
# File 'lib/haml_lint/comment_configuration.rb', line 18 def disabled?(linter_name) most_recent_disabled = directives_for(linter_name).map(&:disable?).first most_recent_disabled || false end |