Class: Lazylead::Required

Inherits:
Requirement show all
Defined in:
lib/lazylead/task/accuracy/required.rb

Overview

Check that ticket has mandatory non-blank field(s).

Direct Known Subclasses

Environment

Instance Attribute Summary

Attributes inherited from Requirement

#desc, #field, #score

Instance Method Summary collapse

Methods inherited from Requirement

#blank?, #non_blank?

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