Class: CvssSuite::Cvss31
Overview
This class represents a CVSS vector in version 3.1.
Instance Attribute Summary
Attributes inherited from Cvss
#base, #environmental, #temporal, #vector
Instance Method Summary collapse
-
#base_score ⇒ Object
Returns the Base Score of the CVSS vector.
-
#environmental_score ⇒ Object
Returns the Environmental Score of the CVSS vector.
-
#temporal_score ⇒ Object
Returns the Temporal Score of the CVSS vector.
-
#version ⇒ Object
Returns the Version of the CVSS vector.
Methods inherited from Cvss
#initialize, #overall_score, #severity, #valid?
Constructor Details
This class inherits a constructor from CvssSuite::Cvss
Instance Method Details
#base_score ⇒ Object
Returns the Base Score of the CVSS vector.
32 33 34 35 |
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 32 def base_score check_validity Cvss31Helper.round_up(@base.score) end |
#environmental_score ⇒ Object
Returns the Environmental Score of the CVSS vector.
47 48 49 50 51 |
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 47 def environmental_score return temporal_score unless @environmental.valid? Cvss31Helper.round_up(@environmental.score(@base, @temporal)) end |
#temporal_score ⇒ Object
Returns the Temporal Score of the CVSS vector.
40 41 42 |
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 40 def temporal_score Cvss31Helper.round_up(Cvss31Helper.round_up(@base.score) * @temporal.score) end |
#version ⇒ Object
Returns the Version of the CVSS vector.
25 26 27 |
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 25 def version 3.1 end |