Class: Lazylead::Required
- Inherits:
-
Requirement
- Object
- Requirement
- Lazylead::Required
- Defined in:
- lib/lazylead/task/accuracy/required.rb
Overview
Check that ticket has mandatory non-blank field(s).
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Requirement
Instance Method Summary collapse
-
#initialize(desc, score, msg, *fields) ⇒ Required
constructor
A new instance of Required.
- #passed(issue) ⇒ Object
Methods inherited from Requirement
Constructor Details
#initialize(desc, score, msg, *fields) ⇒ Required
Returns a new instance of Required.
32 33 34 35 |
# File 'lib/lazylead/task/accuracy/required.rb', line 32 def initialize(desc, score, msg, *fields) super desc, score, msg @fields = fields end |
Instance Method Details
#passed(issue) ⇒ Object
37 38 39 40 |
# File 'lib/lazylead/task/accuracy/required.rb', line 37 def passed(issue) return false if @fields.nil? || @fields.empty? @fields.all? { |f| non_blank?(issue, f) } end |