struct

KEV::Diff

Inherits Struct < Value < Object

Snapshot-vs-snapshot delta for two Catalog instances.

Produced by Catalog#diff(other). Useful for KEV monitoring jobs that want a single "what changed since the last poll" call.

delta = old_catalog.diff(new_catalog)
delta.added.each { |v| notify("new KEV", v) }
delta.removed.each { |v| audit_log("KEV removed", v) }
delta.changed.each { |before, after| diff_log(before, after) }

Membership is keyed by cve_id. changed contains pairs where the CVE appears in both snapshots but at least one other field differs. Use same_cve? semantics when reasoning about identity.

Constructors

new(added : Array(Vulnerability), removed : Array(Vulnerability), changed : Array(Tuple(Vulnerability, Vulnerability)), unchanged : Array(Vulnerability))
Source

Instance methods

added

CVEs in after that were absent from before.

Source
changed

CVEs present in both snapshots whose fields differ. Tuples are (before, after) so callers can render side-by-side diffs.

Source
empty?

true when nothing was added, removed, or modified.

Source
inspect(io : IO) : Nil

Appends this struct's name and instance variables names and values to the given IO.

struct Point
  def initialize(@x : Int32, @y : Int32)
  end
end

p1 = Point.new 1, 2
p1.to_s    # "Point(@x=1, @y=2)"
p1.inspect # "Point(@x=1, @y=2)"
Source
removed

CVEs in before that have been removed in after. CISA does occasionally retract entries; this captures those.

Source
size

Total count of CVEs that differ between the two snapshots (added + removed + changed).

Source
unchanged

CVEs present in both snapshots and field-for-field identical. Not usually rendered, but exposed for completeness so callers can assert "nothing changed" without re-computing.

Source