Class: Archaeo::ArchiveHealthCheck
- Inherits:
-
Object
- Object
- Archaeo::ArchiveHealthCheck
- Defined in:
- lib/archaeo/archive_health_check.rb
Instance Method Summary collapse
- #check(url, from: nil, to: nil, sample: nil) ⇒ Object
-
#initialize(client: HttpClient.new, cdx_api: nil) ⇒ ArchiveHealthCheck
constructor
A new instance of ArchiveHealthCheck.
Constructor Details
#initialize(client: HttpClient.new, cdx_api: nil) ⇒ ArchiveHealthCheck
Returns a new instance of ArchiveHealthCheck.
5 6 7 8 |
# File 'lib/archaeo/archive_health_check.rb', line 5 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
10 11 12 13 14 15 16 |
# File 'lib/archaeo/archive_health_check.rb', line 10 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 |