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) ⇒ 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) ⇒ 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.
20 21 22 23 24 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 20 def initialize(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.
14 15 16 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 14 def environmental @environmental end |
#environmental_security ⇒ Object (readonly)
Metric of a CVSS vector for CVSS 4.0.
14 15 16 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 14 def environmental_security @environmental_security end |
#supplemental ⇒ Object (readonly)
Metric of a CVSS vector for CVSS 4.0.
14 15 16 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 14 def supplemental @supplemental end |
#threat ⇒ Object (readonly)
Metric of a CVSS vector for CVSS 4.0.
14 15 16 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 14 def threat @threat end |
Instance Method Details
#overall_score ⇒ Object
Returns the Overall Score of the CVSS vector.
39 40 41 42 43 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 39 def overall_score check_validity @all_up.score end |
#score ⇒ Object
Alias for overall_score.
47 48 49 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 47 def score overall_score end |
#valid? ⇒ Boolean
Returns if CVSS vector is valid.
28 29 30 31 32 33 34 35 |
# File 'lib/cvss_suite/cvss_40_and_later.rb', line 28 def valid? if @amount_of_properties >= required_amount_of_properties @base.valid? else false end end |