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)
13 14 15 16 17 18 19 20 |
# File 'lib/foodcritic/domain.rb', line 13 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.
6 7 8 |
# File 'lib/foodcritic/domain.rb', line 6 def is_failed @is_failed end |
#match ⇒ Object (readonly)
Returns the value of attribute match.
6 7 8 |
# File 'lib/foodcritic/domain.rb', line 6 def match @match end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
6 7 8 |
# File 'lib/foodcritic/domain.rb', line 6 def rule @rule end |
Instance Method Details
#failed? ⇒ Boolean
If this warning has failed or not.
23 24 25 |
# File 'lib/foodcritic/domain.rb', line 23 def failed? @is_failed end |