Class: FoodCritic::Warning
- Inherits:
-
Object
- Object
- FoodCritic::Warning
- Defined in:
- lib/foodcritic/domain.rb
Overview
A warning of a possible issue
Instance Attribute Summary collapse
-
#is_failed ⇒ Object
readonly
Returns the value of attribute is_failed.
-
#match ⇒ Object
readonly
Returns the value of attribute match.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Instance Method Summary collapse
-
#failed? ⇒ Boolean
If this warning has failed or not.
-
#initialize(rule, match = {}, options = {}) ⇒ Warning
constructor
Create a new warning.
Constructor Details
#initialize(rule, match = {}, options = {}) ⇒ Warning
Create a new warning.
Warning.new(rule, :filename => 'foo/recipes.default.rb',
:line => 5, :column=> 40)
11 12 13 14 15 16 17 18 |
# File 'lib/foodcritic/domain.rb', line 11 def initialize(rule, match = {}, = {}) @rule, @match = rule, match @is_failed = if [:fail_tags].empty? false else rule.([:fail_tags]) end end |
Instance Attribute Details
#is_failed ⇒ Object (readonly)
Returns the value of attribute is_failed.
4 5 6 |
# File 'lib/foodcritic/domain.rb', line 4 def is_failed @is_failed end |
#match ⇒ Object (readonly)
Returns the value of attribute match.
4 5 6 |
# File 'lib/foodcritic/domain.rb', line 4 def match @match end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
4 5 6 |
# File 'lib/foodcritic/domain.rb', line 4 def rule @rule end |
Instance Method Details
#failed? ⇒ Boolean
If this warning has failed or not.
21 22 23 |
# File 'lib/foodcritic/domain.rb', line 21 def failed? @is_failed end |