Class: CvssSuite::Cvss40

Inherits:
Cvss40AndLater show all
Defined in:
lib/cvss_suite/cvss40/cvss40.rb

Overview

This class represents a CVSS vector in version 4.0.

Instance Attribute Summary

Attributes inherited from Cvss40AndLater

#environmental, #environmental_security, #supplemental, #threat

Attributes inherited from Cvss

#base

Instance Method Summary collapse

Methods inherited from Cvss40AndLater

#initialize, #overall_score, #score, #valid?

Methods inherited from Cvss

#initialize, #severity

Constructor Details

This class inherits a constructor from CvssSuite::Cvss40AndLater

Instance Method Details

#base_scoreObject

Returns the base score of the CVSS vector, ignoring threat and environmental metrics -- the base score as published by NVD/GHSA.



36
37
38
39
# File 'lib/cvss_suite/cvss40/cvss40.rb', line 36

def base_score
  check_validity
  @base.score
end

#vectorObject

Returns the vector itself.



29
30
31
# File 'lib/cvss_suite/cvss40/cvss40.rb', line 29

def vector
  "#{CvssSuite::CVSS_VECTOR_BEGINNINGS.find { |beginning| beginning[:version] == version }[:string]}#{@vector}"
end

#versionObject

Returns the Version of the CVSS vector.



23
24
25
# File 'lib/cvss_suite/cvss40/cvss40.rb', line 23

def version
  4.0
end