Class: Textus::Store::Freshness::DriftDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/store/freshness/drift_detector.rb

Instance Method Summary collapse

Constructor Details

#initialize(manifest:, file_stat:, clock:) ⇒ DriftDetector

Returns a new instance of DriftDetector.



9
10
11
12
13
# File 'lib/textus/store/freshness/drift_detector.rb', line 9

def initialize(manifest:, file_stat:, clock:)
  @manifest  = manifest
  @file_stat = file_stat
  @clock     = clock
end

Instance Method Details

#drift_rows(mentry) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/textus/store/freshness/drift_detector.rb', line 15

def drift_rows(mentry)
  return [] unless mentry.external?

  path   = Textus::Key::Path.resolve(@manifest.data, mentry)
  reason = drift_reason(mentry, path)
  reason ? [drift_row(mentry, path, reason)] : []
end