Class: CVESchema::CVE::Impact::CVSSv2::TM
- Inherits:
-
Object
- Object
- CVESchema::CVE::Impact::CVSSv2::TM
- Defined in:
- lib/cve_schema/cve/impact/cvss_v2.rb
Constant Summary collapse
- E =
{'U' => :U, 'POC' => :POC, 'F' => :F, 'H' => :H, 'ND' => :ND}
- RL =
{'OF' => :OF, 'TF' => :TF, 'W' => :W, 'U' => :U, 'ND' => :ND}
- RC =
{'UC' => :UC, 'UR' => :UR, 'C' => :C, 'ND' => :ND}
Instance Attribute Summary collapse
-
#e ⇒ :U, ...
readonly
Exploitability.
-
#rc ⇒ :UC, ...
readonly
Report Confidence.
-
#rl ⇒ :OF, ...
readonly
Remediation Level.
-
#score ⇒ String?
readonly
The CVSSv2 Temporal Metrics Group score assuming all elements are present.
Class Method Summary collapse
-
.from_json(json) ⇒ Hash{Symbol => Object}
Maps the parsed JSON to a Symbol Hash for #initialize.
-
.load(json) ⇒ self
Loads the TM object from the parsed JSON.
Instance Method Summary collapse
-
#initialize(e: nil, rl: nil, rc: nil, score: nil) ⇒ TM
constructor
A new instance of TM.
Constructor Details
#initialize(e: nil, rl: nil, rc: nil, score: nil) ⇒ TM
Returns a new instance of TM.
135 136 137 138 139 140 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 135 def initialize(e: nil, rl: nil, rc: nil, score: nil) @e = e @rl = rl @rc = rc @score = score end |
Instance Attribute Details
#e ⇒ :U, ... (readonly)
Exploitability
114 115 116 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 114 def e @e end |
#rc ⇒ :UC, ... (readonly)
Report Confidence.
128 129 130 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 128 def rc @rc end |
#rl ⇒ :OF, ... (readonly)
Remediation Level.
121 122 123 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 121 def rl @rl end |
#score ⇒ String? (readonly)
The CVSSv2 Temporal Metrics Group score assuming all elements are present.
133 134 135 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 133 def score @score end |
Class Method Details
.from_json(json) ⇒ Hash{Symbol => Object}
Maps the parsed JSON to a Symbol Hash for #initialize.
151 152 153 154 155 156 157 158 159 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 151 def self.from_json(json) { e: E[json['E']], rl: RL[json['RL']], rc: RC[json['RC']], score: json['SCORE'] } end |
.load(json) ⇒ self
Loads the TM object from the parsed JSON.
170 171 172 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 170 def self.load(json) new(**from_json(json)) end |