class CVESchema::CVE::Impact::CVSSv3::EM

Constants

AR
CR
IR
MA
MAC
MAV
MC
MI
MPR
MS
MUI

Attributes

ar[R]

Security Requirements Availability.

@return [:X, :H, :M, :L]

cr[R]

Security Requirements Confidentiality.

@return [:X, :H, :M, :L]

ir[R]

Security Requirements Integrity.

@return [:X, :H, :M, :L]

ma[R]

The Modified Availability Impact.

@return [:H, :L, :N]

mac[R]

The Modified Attack Complexity.

@return [:L, :H]

mav[R]

The Modified Attack Vector.

@return [:N, :A, :L, :P]

mc[R]

The Modified Confidentiality Impact.

@return [:H, :L, :N]

mi[R]

The Modified Integrity Impact.

@return [:H, :L, :N]

mpr[R]

The Modified Privileges Required.

@return [:N, :L, :H]

ms[R]

The Modified Scope.

@return [:U, :C]

mui[R]

The Modified User Interaction.

@return [:N, :R]

Public Class Methods

from_json(json) click to toggle source

Maps the parsed JSON to a Symbol Hash for {#initialize}.

@param [Hash{String => Object}] json

The parsed JSON.

@return [Hash{Symbol => Object}]

The mapped Symbol Hash.
# File lib/cve_schema/cve/impact/cvss_v3.rb, line 306
def self.from_json(json)
  {
    cr:  CR[json['CR']],
    ir:  IR[json['IR']],
    ar:  AR[json['AR']],
    mav: MAV[json['MAV']],
    mac: MAC[json['MAC']],
    mpr: MPR[json['MPR']],
    mui: MUI[json['MUI']],
    ms:  MS[json['MS']],
    mc:  MC[json['MC']],
    mi:  MI[json['MI']],
    ma:  MA[json['MA']]
  }
end
load(json) click to toggle source

Loads the EM object from the parsed JSON.

@param [Hash{String => Object}] json

The parsed JSON.

@return [EM]

The loaded EM object.
# File lib/cve_schema/cve/impact/cvss_v3.rb, line 331
def self.load(json)
  new(**from_json(json))
end
new(cr: nil, ir: nil, ar: nil, mav: nil, mac: nil, mpr: nil, mui: nil, ms: nil, mc: nil, mi: nil, ma: nil) click to toggle source

Initializes the EM object.

# File lib/cve_schema/cve/impact/cvss_v3.rb, line 282
def initialize(cr: nil, ir: nil, ar: nil, mav: nil, mac: nil,
               mpr: nil, mui: nil, ms: nil, mc: nil, mi: nil, ma: nil)
  @cr  = cr
  @ir  = ir
  @ar  = ar
  @mav = mav
  @mac = mac
  @mpr = mpr
  @mui = mui
  @ms  = ms
  @mc  = mc
  @mi  = mi
  @ma  = ma
end