Class: CVESchema::CVE::Impact::CVSSv2::EM
- Inherits:
-
Object
- Object
- CVESchema::CVE::Impact::CVSSv2::EM
- Defined in:
- lib/cve_schema/cve/impact/cvss_v2.rb
Constant Summary collapse
- CDP =
{ 'N' => :N, 'L' => :L, 'LM' => :LM, 'MH' => :MH, 'H' => :H, 'ND' => :ND }
- TD =
{'N' => :N, 'L' => :L, 'M' => :M, 'H' => :H, 'ND' => :ND}
- CR =
{'L' => :L, 'M' => :M, 'H' => :H, 'ND' => :ND}
- IR =
{'L' => :L, 'M' => :M, 'H' => :H, 'ND' => :ND}
- AR =
{'L' => :L, 'M' => :M, 'H' => :H, 'ND' => :ND}
Instance Attribute Summary collapse
-
#ar ⇒ :L, ...
readonly
Security Requirements Availability.
-
#cdp ⇒ :N, ...
readonly
The Collateral Damage Potential.
-
#cr ⇒ :L, ...
readonly
Security Requirements Confidentiality.
-
#ir ⇒ :L, ...
readonly
Security Requirements Integrity.
-
#td ⇒ :N, ...
readonly
The Target Distribution.
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 EM object from the parsed JSON.
Instance Method Summary collapse
-
#initialize(cdp: nil, td: nil, cr: nil, ir: nil, ar: nil) ⇒ EM
constructor
A new instance of EM.
Constructor Details
#initialize(cdp: nil, td: nil, cr: nil, ir: nil, ar: nil) ⇒ EM
Returns a new instance of EM.
225 226 227 228 229 230 231 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 225 def initialize(cdp: nil, td: nil, cr: nil, ir: nil, ar: nil) @cdp = cdp @td = td @cr = cr @ir = ir @ar = ar end |
Instance Attribute Details
#ar ⇒ :L, ... (readonly)
Security Requirements Availability.
223 224 225 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 223 def ar @ar end |
#cdp ⇒ :N, ... (readonly)
The Collateral Damage Potential.
195 196 197 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 195 def cdp @cdp end |
#cr ⇒ :L, ... (readonly)
Security Requirements Confidentiality.
209 210 211 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 209 def cr @cr end |
#ir ⇒ :L, ... (readonly)
Security Requirements Integrity.
216 217 218 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 216 def ir @ir end |
#td ⇒ :N, ... (readonly)
The Target Distribution.
202 203 204 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 202 def td @td end |
Class Method Details
.from_json(json) ⇒ Hash{Symbol => Object}
Maps the parsed JSON to a Symbol Hash for #initialize.
242 243 244 245 246 247 248 249 250 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 242 def self.from_json(json) { cdp: CDP[json['CDP']], td: TD[json['TD']], cr: CR[json['CR']], ir: IR[json['IR']], ar: AR[json['AR']] } end |
.load(json) ⇒ self
Loads the EM object from the parsed JSON.
261 262 263 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 261 def self.load(json) new(**from_json(json)) end |