Class: Ucode::Audit::Release::FormulaAudits
- Inherits:
-
Struct
- Object
- Struct
- Ucode::Audit::Release::FormulaAudits
- Defined in:
- lib/ucode/audit/release/formula_audits.rb
Overview
Value object pairing a formula slug with the library-wide audit summary produced by running LibraryAuditor on that formula's font directory.
Used as the input unit to Emitter: callers pass a list of
these and the emitter walks each one's summary.per_face_reports
to emit the per-face audit subtrees.
The slug MUST be caller-sanitized (fontist formula slug form:
lowercase, hyphen-separated, filesystem-safe). The emitter does
not re-sanitize — it uses the slug verbatim as the directory
name under <release_root>/audit/.
Instance Attribute Summary collapse
-
#slug ⇒ Object
Returns the value of attribute slug.
-
#summary ⇒ Object
Returns the value of attribute summary.
Instance Method Summary collapse
- #face_reports ⇒ Enumerable<Models::Audit::AuditReport>
-
#faces_total ⇒ Integer
Number of face reports in the summary.
-
#initialize(slug:, summary:) ⇒ FormulaAudits
constructor
Sanity check at construction time so a malformed slug fails fast at the call site instead of producing a broken tree.
Constructor Details
#initialize(slug:, summary:) ⇒ FormulaAudits
Sanity check at construction time so a malformed slug fails fast at the call site instead of producing a broken tree.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ucode/audit/release/formula_audits.rb', line 21 def initialize(slug:, summary:) raise ArgumentError, "slug must not be empty" if slug.to_s.strip.empty? raise ArgumentError, "slug contains path separators: #{slug.inspect}" if slug[%r{/}] raise ArgumentError, "summary is required" unless summary slug = slug.to_s raise ArgumentError, "slug is not filesystem-safe: #{slug.inspect}" unless safe_slug?(slug) super(slug: slug, summary: summary) end |
Instance Attribute Details
#slug ⇒ Object
Returns the value of attribute slug
18 19 20 |
# File 'lib/ucode/audit/release/formula_audits.rb', line 18 def slug @slug end |
#summary ⇒ Object
Returns the value of attribute summary
18 19 20 |
# File 'lib/ucode/audit/release/formula_audits.rb', line 18 def summary @summary end |
Instance Method Details
#face_reports ⇒ Enumerable<Models::Audit::AuditReport>
38 39 40 |
# File 'lib/ucode/audit/release/formula_audits.rb', line 38 def face_reports summary.per_face_reports end |
#faces_total ⇒ Integer
Returns number of face reports in the summary.
33 34 35 |
# File 'lib/ucode/audit/release/formula_audits.rb', line 33 def faces_total summary.total_faces end |