Class: Lazylead::Task::When

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/lazylead/task/alert/alertif.rb

Overview

The conditions for the issue inspection.

Instance Method Summary collapse

Constructor Details

#initialize(issue, opts) ⇒ When

Returns a new instance of When.



59
60
61
62
# File 'lib/lazylead/task/alert/alertif.rb', line 59

def initialize(issue, opts)
  @issue = issue
  @opts = opts
end

Instance Method Details

#lastObject

The last comment in ticket



70
71
72
# File 'lib/lazylead/task/alert/alertif.rb', line 70

def last
  @last ||= @issue.comments.last
end

#matchesObject



64
65
66
67
# File 'lib/lazylead/task/alert/alertif.rb', line 64

def matches
  return false if @opts[:rules].nil?
  @opts[:rules].all? { |r| r.passed(@issue, @opts) }
end