Class: CvssSuite::Cvss31
- Inherits:
-
Cvss31AndBefore
- Object
- Cvss
- Cvss31AndBefore
- CvssSuite::Cvss31
- Defined in:
- lib/cvss_suite/cvss31/cvss31.rb
Overview
This class represents a CVSS vector in version 3.1.
Instance Attribute Summary
Attributes inherited from Cvss31AndBefore
Attributes inherited from Cvss
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 Cvss31AndBefore
#initialize, #overall_score, #valid?
Methods inherited from Cvss
Constructor Details
This class inherits a constructor from CvssSuite::Cvss31AndBefore
Instance Method Details
#base_score ⇒ Object
Returns the Base Score of the CVSS vector.
28 29 30 31 |
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 28 def base_score check_validity Cvss31Helper.round_up(@base.score) end |
#environmental_score ⇒ Object
Returns the Environmental Score of the CVSS vector.
44 45 46 47 48 49 |
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 44 def environmental_score check_validity 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.
36 37 38 39 |
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 36 def temporal_score check_validity Cvss31Helper.round_up(Cvss31Helper.round_up(@base.score) * @temporal.score) end |
#vector ⇒ Object
Returns the vector itself.
53 54 55 |
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 53 def vector "#{CvssSuite::CVSS_VECTOR_BEGINNINGS.find { |beginning| beginning[:version] == version }[:string]}#{@vector}" end |
#version ⇒ Object
Returns the Version of the CVSS vector.
21 22 23 |
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 21 def version 3.1 end |