Class: Lazylead::Attachment

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

Overview

Check that ticket has an attachment.

Direct Known Subclasses

Logs, Records

Instance Attribute Summary

Attributes inherited from Requirement

#desc, #field, #score

Instance Method Summary collapse

Methods inherited from Requirement

#blank?, #initialize, #non_blank?

Constructor Details

This class inherits a constructor from Lazylead::Requirement

Instance Method Details

#matches?(attachment) ⇒ Boolean

Check a single attachment from ticket. Potential extension point for custom verification logic.

Returns:

  • (Boolean)


37
38
39
# File 'lib/lazylead/task/accuracy/attachment.rb', line 37

def matches?(attachment)
  !attachment.nil?
end

#passed(issue) ⇒ Object



30
31
32
33
# File 'lib/lazylead/task/accuracy/attachment.rb', line 30

def passed(issue)
  return false if issue.nil? || issue.attachments.nil?
  issue.attachments.any? { |a| matches?(a) }
end