Class: CvssSuite::Cvss40AllUp

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

Overview

This class represents all CVSS metrics combined in version 4.0.

Instance Attribute Summary

Attributes inherited from CvssMetric

#properties

Instance Method Summary collapse

Methods inherited from CvssMetric

#count, #valid?

Constructor Details

#initialize(properties, base, threat, environmental, environmental_security, supplemental) ⇒ Cvss40AllUp

Returns a new instance of Cvss40AllUp.



21
22
23
24
25
26
27
28
29
# File 'lib/cvss_suite/cvss40/cvss40_all_up.rb', line 21

def initialize(properties, base, threat, environmental, environmental_security, supplemental)
  @properties_to_later_initialize_from = properties
  @base = base
  @threat = threat
  @environmental = environmental
  @environmental_security = environmental_security
  @supplemental = supplemental
  super(properties)
end

Instance Method Details

#scoreObject

Returns score of this metric



17
18
19
# File 'lib/cvss_suite/cvss40/cvss40_all_up.rb', line 17

def score
  Cvss40CalcHelper.new(@properties.map { |p| [p.abbreviation, p.selected_value[:abbreviation]] }.to_h).score
end