Class: IssueBeaver::Models::Matcher
- Inherits:
-
Object
- Object
- IssueBeaver::Models::Matcher
- Defined in:
- lib/issue_beaver/models/merger.rb
Instance Method Summary collapse
-
#initialize(issues, todos) ⇒ Matcher
constructor
A new instance of Matcher.
- #matches ⇒ Object
Constructor Details
#initialize(issues, todos) ⇒ Matcher
Returns a new instance of Matcher.
49 50 51 52 |
# File 'lib/issue_beaver/models/merger.rb', line 49 def initialize(issues, todos) @issue_matcher = IssueMatcher.new(issues) @todos = todos end |
Instance Method Details
#matches ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/issue_beaver/models/merger.rb', line 55 def matches @matches ||= Enumerator.new do |yielder| @todos.each do |todo| match = @issue_matcher.find_and_check_off(todo) issue = match ? match.issue : nil yielder << [todo, issue] end end.memoizing.lazy end |