Class: Archaeo::ArchiveHealthCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/archaeo/archive_health_check.rb

Instance Method Summary collapse

Constructor Details

#initialize(client: HttpClient.new, cdx_api: nil) ⇒ ArchiveHealthCheck

Returns a new instance of ArchiveHealthCheck.



19
20
21
22
# File 'lib/archaeo/archive_health_check.rb', line 19

def initialize(client: HttpClient.new, cdx_api: nil)
  @client = client
  @cdx_api = cdx_api
end

Instance Method Details

#check(url, from: nil, to: nil, sample: nil) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/archaeo/archive_health_check.rb', line 24

def check(url, from: nil, to: nil, sample: nil)
  snapshots = fetch_snapshots(url, from: from, to: to)
  snapshots = sample_snapshots(snapshots, sample) if sample

  details = check_snapshots(snapshots)
  build_report(details)
end