Class: Ucode::Audit::FaceAuditor
- Inherits:
-
Object
- Object
- Ucode::Audit::FaceAuditor
- Defined in:
- lib/ucode/audit/face_auditor.rb
Overview
Per-face orchestrator: takes a font path, runs every Extractor in the Registry, and assembles a single Models::Audit::AuditReport.
For standalone fonts (TTF/OTF/WOFF/WOFF2) #call returns one
AuditReport. For collections (TTC/OTC/dfont) it returns
Array
Extracted as its own class so LibraryAuditor (per-file iteration) and the future CLI AuditCommand (single face) share one orchestration path. Neither caller enumerates extractors directly — they go through this class and the Registry.
Instance Method Summary collapse
- #call ⇒ Models::Audit::AuditReport+
-
#initialize(font_path, options: {}, mode: :full, font_index: nil, reference: nil) ⇒ FaceAuditor
constructor
A new instance of FaceAuditor.
Constructor Details
#initialize(font_path, options: {}, mode: :full, font_index: nil, reference: nil) ⇒ FaceAuditor
Returns a new instance of FaceAuditor.
30 31 32 33 34 35 36 37 |
# File 'lib/ucode/audit/face_auditor.rb', line 30 def initialize(font_path, options: {}, mode: :full, font_index: nil, reference: nil) @font_path = font_path.to_s @options = @mode = mode @font_index = font_index @reference = reference end |
Instance Method Details
#call ⇒ Models::Audit::AuditReport+
40 41 42 43 44 45 46 |
# File 'lib/ucode/audit/face_auditor.rb', line 40 def call if Fontisan::FontLoader.collection?(@font_path) audit_collection else audit_face(load_face(0), 0, 1) end end |