Class: CurationConcerns::FileSetAuditService
- Inherits:
-
Object
- Object
- CurationConcerns::FileSetAuditService
- Defined in:
- app/services/curation_concerns/file_set_audit_service.rb
Constant Summary collapse
- NO_RUNS =
999
Instance Attribute Summary collapse
-
#file_set ⇒ Object
readonly
Returns the value of attribute file_set.
Instance Method Summary collapse
-
#audit(log = {}) ⇒ Object
Audits each version of each file if it hasn’t been audited recently Returns the set of most recent audit status for each version of the content file.
-
#human_readable_audit_status(stat) ⇒ Object
provides a human readable version of the audit status.
-
#initialize(file) ⇒ FileSetAuditService
constructor
A new instance of FileSetAuditService.
Constructor Details
#initialize(file) ⇒ FileSetAuditService
Returns a new instance of FileSetAuditService.
4 5 6 |
# File 'app/services/curation_concerns/file_set_audit_service.rb', line 4 def initialize(file) @file_set = file end |
Instance Attribute Details
#file_set ⇒ Object (readonly)
Returns the value of attribute file_set.
3 4 5 |
# File 'app/services/curation_concerns/file_set_audit_service.rb', line 3 def file_set @file_set end |
Instance Method Details
#audit(log = {}) ⇒ Object
Audits each version of each file if it hasn’t been audited recently Returns the set of most recent audit status for each version of the content file
25 26 27 28 |
# File 'app/services/curation_concerns/file_set_audit_service.rb', line 25 def audit(log = {}) file_set.files.each { |f| log[f.id] = audit_file(f) } log end |
#human_readable_audit_status(stat) ⇒ Object
provides a human readable version of the audit status
11 12 13 14 15 16 17 18 19 20 |
# File 'app/services/curation_concerns/file_set_audit_service.rb', line 11 def human_readable_audit_status(stat) case stat when 0 'failing' when 1 'passing' else stat end end |