Class: QuietQuality::AnnotationLocator
- Inherits:
-
Object
- Object
- QuietQuality::AnnotationLocator
- Defined in:
- lib/quiet_quality/annotation_locator.rb
Instance Method Summary collapse
-
#initialize(changed_files:) ⇒ AnnotationLocator
constructor
A new instance of AnnotationLocator.
- #update!(message) ⇒ Object
- #update_all!(messages) ⇒ Object
Constructor Details
#initialize(changed_files:) ⇒ AnnotationLocator
Returns a new instance of AnnotationLocator.
3 4 5 |
# File 'lib/quiet_quality/annotation_locator.rb', line 3 def initialize(changed_files:) @changed_files = changed_files end |
Instance Method Details
#update!(message) ⇒ Object
7 8 9 10 |
# File 'lib/quiet_quality/annotation_locator.rb', line 7 def update!() changed_file = changed_files.file(.path) .annotated_line = changed_file ? file_line_for(, changed_file) : nil end |
#update_all!(messages) ⇒ Object
12 13 14 |
# File 'lib/quiet_quality/annotation_locator.rb', line 12 def update_all!() .map { |m| update!(m) }.compact.length end |