class ClippingsPluck::Clippings
Public Instance Methods
closest_highlight(note_location)
click to toggle source
# File lib/clippings_pluck/clippings.rb, line 3 def closest_highlight(note_location) sorted_eligible_note_matches(note_location.normalize).last end
with_notes()
click to toggle source
# File lib/clippings_pluck/clippings.rb, line 7 def with_notes select(&:notated?) end
without_notes()
click to toggle source
# File lib/clippings_pluck/clippings.rb, line 11 def without_notes self - with_notes end
Private Instance Methods
eligible_note_matches(location)
click to toggle source
# File lib/clippings_pluck/clippings.rb, line 21 def eligible_note_matches(location) select { |clipping| clipping.eligible_for_note_attachment?(location) } end
sorted_eligible_note_matches(location)
click to toggle source
# File lib/clippings_pluck/clippings.rb, line 17 def sorted_eligible_note_matches(location) eligible_note_matches(location).sort_by(&:normalized_location) end