Class: Yardstick::RuleConfig
- Inherits:
-
Object
- Object
- Yardstick::RuleConfig
- Defined in:
- lib/yardstick/rule_config.rb
Overview
Config class for rules
It is used to check if document should be validated or not.
Constant Summary collapse
- METHOD_SEPARATOR =
/\#|\./.freeze
Instance Method Summary collapse
-
#enabled_for_path?(path) ⇒ Boolean
private
Checks if given path should be checked using this rule.
-
#initialize(options = {}) ⇒ Yardstick::RuleConfig
constructor
private
Initializes new instance of rule config.
Constructor Details
#initialize(options = {}) ⇒ Yardstick::RuleConfig
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes new instance of rule config
19 20 21 22 |
# File 'lib/yardstick/rule_config.rb', line 19 def initialize( = {}) @enabled = .fetch(:enabled, true) @exclude = .fetch(:exclude, []) end |
Instance Method Details
#enabled_for_path?(path) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Checks if given path should be checked using this rule
33 34 35 |
# File 'lib/yardstick/rule_config.rb', line 33 def enabled_for_path?(path) @enabled && !exclude?(path) end |