Class: Ucode::Models::Audit::BlockSummary
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Ucode::Models::Audit::BlockSummary
- Defined in:
- lib/ucode/models/audit/block_summary.rb
Overview
One Unicode block coverage row on an AuditReport.
Replaces fontisan’s ‘AuditBlock`. Carries per-block coverage computed against ucode’s own UCD baseline (not the legacy ucd.all.flat.zip), plus an explicit ‘status` enum so consumers can filter/sort without recomputing from raw counts.
Constant Summary collapse
- STATUS_COMPLETE =
"COMPLETE"- STATUS_PARTIAL =
"PARTIAL"- STATUS_UNCOVERED_ASSIGNED =
"UNCOVERED_ASSIGNED"- STATUS_NO_ASSIGNED_IN_BLOCK =
"NO_ASSIGNED_IN_BLOCK"- STATUS_OUTSIDE_BASELINE =
"OUTSIDE_BASELINE"
Class Method Summary collapse
-
.derive_status(covered_count:, total_assigned:, in_baseline: true) ⇒ String
Derive the canonical status string for a block given its counts.
Class Method Details
.derive_status(covered_count:, total_assigned:, in_baseline: true) ⇒ String
Derive the canonical status string for a block given its counts. Centralized so the Aggregations extractor and any downstream consumer compute identically.
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/ucode/models/audit/block_summary.rb', line 59 def self.derive_status(covered_count:, total_assigned:, in_baseline: true) return STATUS_OUTSIDE_BASELINE unless in_baseline return STATUS_NO_ASSIGNED_IN_BLOCK if total_assigned.zero? case covered_count when total_assigned then STATUS_COMPLETE when 0 then STATUS_UNCOVERED_ASSIGNED else STATUS_PARTIAL end end |