CVSS::V3::Vector
Inherits CVSS::Vector < Comparable < Reference < Object
CVSS v3.x vector. Handles both v3.0 and v3.1 — they share metric definitions and only differ in the RoundUp algorithm and the modified impact formula.
vec = CVSS::V3::Vector.parse("CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H")
vec.base_score # => 9.8
vec.severity # => CVSS::Severity::Critical
Constants
The eight required base metrics. A parse failure if any is missing.
Canonical metric ordering used by to_s. Matches the FIRST calculator.
Constructors
Class methods
Instance methods
Returns true if this reference is the same as other. Invokes same?.
See Object#hash(hasher)
Returns the stored short-code for a metric. Optional metrics that have
not been set return "X" (the v3 NotDefined code). Raises
CVSS::Error if name is not a recognised v3 metric key.
Returns a Hash(String, String) of metric short-codes, in canonical
order. Optional metrics are only included when set.
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>