Class: Aireview::CandidateChecker::Section
- Inherits:
-
Struct
- Object
- Struct
- Aireview::CandidateChecker::Section
- Defined in:
- lib/aireview/candidate_checker.rb
Overview
One file of the context: the new-file line ranges of the shown hunks and the normalized text of every hunk for the quote search — the new side (context + added lines) and the old side (context + removed lines) separately, so that a multi-line quote from one version of the file is found whole. Hunks are not glued together: there is skipped code between them, and a quote across a hunk boundary is not a quote.
Instance Attribute Summary collapse
-
#hunks ⇒ Object
Returns the value of attribute hunks.
-
#partial ⇒ Object
Returns the value of attribute partial.
-
#ranges ⇒ Object
Returns the value of attribute ranges.
Instance Method Summary collapse
Instance Attribute Details
#hunks ⇒ Object
Returns the value of attribute hunks
25 26 27 |
# File 'lib/aireview/candidate_checker.rb', line 25 def hunks @hunks end |
#partial ⇒ Object
Returns the value of attribute partial
25 26 27 |
# File 'lib/aireview/candidate_checker.rb', line 25 def partial @partial end |
#ranges ⇒ Object
Returns the value of attribute ranges
25 26 27 |
# File 'lib/aireview/candidate_checker.rb', line 25 def ranges @ranges end |
Instance Method Details
#include?(quote) ⇒ Boolean
26 27 28 |
# File 'lib/aireview/candidate_checker.rb', line 26 def include?(quote) hunks.any? { |hunk| hunk[:new_text].include?(quote) || hunk[:old_text].include?(quote) } end |