Class: Lazylead::Requirement

Inherits:
Object
  • Object
show all
Defined in:
lib/lazylead/task/accuracy/requirement.rb

Overview

An single requirement regarding ticket format.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(desc, score, field) ⇒ Requirement

Returns a new instance of Requirement.



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

def initialize(desc, score, field)
  @desc = desc
  @score = score
  @field = field
end

Instance Attribute Details

#descObject (readonly)

Returns the value of attribute desc.



28
29
30
# File 'lib/lazylead/task/accuracy/requirement.rb', line 28

def desc
  @desc
end

#fieldObject (readonly)

Returns the value of attribute field.



28
29
30
# File 'lib/lazylead/task/accuracy/requirement.rb', line 28

def field
  @field
end

#scoreObject (readonly)

Returns the value of attribute score.



28
29
30
# File 'lib/lazylead/task/accuracy/requirement.rb', line 28

def score
  @score
end

Instance Method Details

#blank?(issue, field) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
43
# File 'lib/lazylead/task/accuracy/requirement.rb', line 40

def blank?(issue, field)
  return false if issue.nil?
  issue.fields[field].nil? || issue.fields[field].blank?
end

#non_blank?(issue, field) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/lazylead/task/accuracy/requirement.rb', line 45

def non_blank?(issue, field)
  !blank? issue, field
end

#passed(_) ⇒ Object



36
37
38
# File 'lib/lazylead/task/accuracy/requirement.rb', line 36

def passed(_)
  true
end