Class: CvssSuite::Cvss40AndLater
- Defined in:
- lib/cvss_suite/cvss_40_and_later.rb
Overview
This class represents any CVSS vector. Do not instantiate this class!
Direct Known Subclasses
Instance Attribute Summary collapse
-
#environmental ⇒ Object
readonly
Metric of a CVSS vector for CVSS 4.0.
-
#environmental_security ⇒ Object
readonly
Metric of a CVSS vector for CVSS 4.0.
-
#supplemental ⇒ Object
readonly
Metric of a CVSS vector for CVSS 4.0.
-
#threat ⇒ Object
readonly
Metric of a CVSS vector for CVSS 4.0.
Attributes inherited from Cvss
Instance Method Summary collapse
-
#initialize(vector, original = vector) ⇒ Cvss40AndLater
constructor
Creates a new CVSS vector by a
vector, for all CVSS versions from 4.0. -
#overall_score ⇒ Object
Returns the Overall Score of the CVSS vector.
-
#score ⇒ Object
Alias for overall_score.
-
#valid? ⇒ Boolean
Returns if CVSS vector is valid.
Methods inherited from Cvss
Constructor Details
#initialize(vector, original = vector) ⇒ Cvss40AndLater
Creates a new CVSS vector by a vector, for all CVSS versions from 4.0.
Raises an exception if it is called on Cvss40AndLater class.
22 23 24 25 26 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 22 def initialize(vector, original = vector) raise CvssSuite::Errors::InvalidParentClass, 'Do not instantiate this class!' if instance_of? Cvss40AndLater super end |
Instance Attribute Details
#environmental ⇒ Object (readonly)
Metric of a CVSS vector for CVSS 4.0.
16 17 18 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 16 def environmental @environmental end |
#environmental_security ⇒ Object (readonly)
Metric of a CVSS vector for CVSS 4.0.
16 17 18 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 16 def environmental_security @environmental_security end |
#supplemental ⇒ Object (readonly)
Metric of a CVSS vector for CVSS 4.0.
16 17 18 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 16 def supplemental @supplemental end |
#threat ⇒ Object (readonly)
Metric of a CVSS vector for CVSS 4.0.
16 17 18 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 16 def threat @threat end |
Instance Method Details
#overall_score ⇒ Object
Returns the Overall Score of the CVSS vector.
41 42 43 44 45 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 41 def overall_score check_validity @all_up.score end |
#score ⇒ Object
Alias for overall_score.
49 50 51 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 49 def score overall_score end |
#valid? ⇒ Boolean
Returns if CVSS vector is valid.
30 31 32 33 34 35 36 37 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 30 def valid? if @amount_of_properties >= required_amount_of_properties @base.valid? else false end end |