Class: CvssSuite::CvssMetric
- Inherits:
-
Object
- Object
- CvssSuite::CvssMetric
- Defined in:
- lib/cvss_suite/cvss_metric.rb
Overview
This class represents any CVSS metric.
Direct Known Subclasses
Cvss2Base, Cvss2Environmental, Cvss2Temporal, Cvss31Base, Cvss31Environmental, Cvss31Temporal, Cvss3Base, Cvss3Environmental, Cvss3Temporal, Cvss40AllUp, Cvss40Base, Cvss40Environmental, Cvss40EnvironmentalSecurity, Cvss40Supplemental, Cvss40Threat
Instance Attribute Summary collapse
-
#properties ⇒ Object
readonly
We aggregate these in some other classes.
Instance Method Summary collapse
-
#count ⇒ Object
Returns number of properties for this metric.
-
#initialize(selected_properties) ⇒ CvssMetric
constructor
Creates a new CVSS metric by
properties
. -
#valid? ⇒ Boolean
Returns if the metric is valid.
Constructor Details
#initialize(selected_properties) ⇒ CvssMetric
Creates a new CVSS metric by properties
12 13 14 15 16 |
# File 'lib/cvss_suite/cvss_metric.rb', line 12 def initialize(selected_properties) @properties = [] init_properties extract_selected_values_from selected_properties end |
Instance Attribute Details
#properties ⇒ Object (readonly)
We aggregate these in some other classes
35 36 37 |
# File 'lib/cvss_suite/cvss_metric.rb', line 35 def properties @properties end |
Instance Method Details
#count ⇒ Object
Returns number of properties for this metric.
29 30 31 |
# File 'lib/cvss_suite/cvss_metric.rb', line 29 def count @properties.count end |
#valid? ⇒ Boolean
Returns if the metric is valid.
20 21 22 23 24 25 |
# File 'lib/cvss_suite/cvss_metric.rb', line 20 def valid? @properties.each do |property| return false unless property.valid? end true end |