Class: CvssSuite::Cvss3
Overview
This class represents a CVSS vector in version 3.0.
Instance Attribute Summary
Attributes inherited from Cvss
#base, #environmental, #temporal
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.
-
#vector ⇒ Object
Returns the vector itself.
-
#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.
29 30 31 32 |
# File 'lib/cvss_suite/cvss3/cvss3.rb', line 29 def base_score check_validity Cvss3Helper.round_up(@base.score) end |
#environmental_score ⇒ Object
Returns the Environmental Score of the CVSS vector.
42 43 44 45 46 |
# File 'lib/cvss_suite/cvss3/cvss3.rb', line 42 def environmental_score return temporal_score unless @environmental.valid? Cvss3Helper.round_up(@environmental.score(@base, @temporal)) end |
#temporal_score ⇒ Object
Returns the Temporal Score of the CVSS vector.
36 37 38 |
# File 'lib/cvss_suite/cvss3/cvss3.rb', line 36 def temporal_score Cvss3Helper.round_up(Cvss3Helper.round_up(@base.score) * @temporal.score) end |
#vector ⇒ Object
Returns the vector itself.
50 51 52 |
# File 'lib/cvss_suite/cvss3/cvss3.rb', line 50 def vector "#{CvssSuite::CVSS_VECTOR_BEGINNINGS.find { |beginning| beginning[:version] == version }[:string]}#{@vector}" end |
#version ⇒ Object
Returns the Version of the CVSS vector.
23 24 25 |
# File 'lib/cvss_suite/cvss3/cvss3.rb', line 23 def version 3.0 end |