Class: CVESchema::CVE::Impact::CVSSv2
- Inherits:
-
Object
- Object
- CVESchema::CVE::Impact::CVSSv2
- Defined in:
- lib/cve_schema/cve/impact/cvss_v2.rb
Defined Under Namespace
Instance Attribute Summary collapse
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 CVSSv2 object from the parsed JSON.
Instance Method Summary collapse
-
#initialize(bm: nil, tm: nil, em: nil) ⇒ CVSSv2
constructor
Initializes the CVSSv2.
Constructor Details
#initialize(bm: nil, tm: nil, em: nil) ⇒ CVSSv2
Initializes the CVSSv2.
279 280 281 282 283 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 279 def initialize(bm: nil, tm: nil, em: nil) @bm = bm @tm = tm @em = em end |
Instance Attribute Details
#bm ⇒ BM? (readonly)
105 106 107 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 105 def bm @bm end |
#em ⇒ EM? (readonly)
268 269 270 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 268 def em @em end |
#tm ⇒ TM? (readonly)
The Temporal Metrics Group.
179 180 181 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 179 def tm @tm end |
Class Method Details
.from_json(json) ⇒ Hash{Symbol => Object}
Maps the parsed JSON to a Symbol Hash for #initialize.
294 295 296 297 298 299 300 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 294 def self.from_json(json) { bm: json['BM'] && BM.load(json['BM']), tm: json['TM'] && TM.load(json['TM']), em: json['EM'] && EM.load(json['EM']), } end |
.load(json) ⇒ self
Loads the CVSSv2 object from the parsed JSON.
311 312 313 |
# File 'lib/cve_schema/cve/impact/cvss_v2.rb', line 311 def self.load(json) new(**from_json(json)) end |