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.
7 8 9 |
# File 'lib/haml_lint/comment_configuration.rb', line 7 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.
16 17 18 19 20 |
# File 'lib/haml_lint/comment_configuration.rb', line 16 def disabled?(linter_name) most_recent_disabled = directives_for(linter_name).map(&:disable?).first most_recent_disabled || false end |