Class: Danger::MatchesInDiff

Inherits:
Struct
  • Object
show all
Defined in:
lib/todoist/diff_todo_finder.rb

Overview

Identify todos in a single diff

Defined Under Namespace

Classes: Line, Patch

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#diffObject

Returns the value of attribute diff

Returns:

  • (Object)

    the current value of diff



35
36
37
# File 'lib/todoist/diff_todo_finder.rb', line 35

def diff
  @diff
end

#matchesObject

Returns the value of attribute matches

Returns:

  • (Object)

    the current value of matches



35
36
37
# File 'lib/todoist/diff_todo_finder.rb', line 35

def matches
  @matches
end

Instance Method Details

#all_todosObject



40
41
42
# File 'lib/todoist/diff_todo_finder.rb', line 40

def all_todos
  matches.map { |match| build_todo(diff.path, match) }
end

#todo_matches?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/todoist/diff_todo_finder.rb', line 36

def todo_matches?
  !matches.empty?
end