class CVESchema::CVE::ProblemType
Represents an element within the `“problemtype_data”` JSON Array.
Attributes
description[R]
@return [Array<Description>]
descriptions[R]
@return [Array<Description>]
Public Class Methods
from_json(json)
click to toggle source
Maps the parsed JSON to an Array of {Description} objects for {#initialize}.
@param [Hash{String => Object}] json
The parsed JSON.
@return [Array<Description>]
@api semipublic
# File lib/cve_schema/cve/problem_type.rb, line 35 def self.from_json(json) json['description'].map(&Description.method(:load)) end
load(json)
click to toggle source
Loads the problem-type object from parsed JSON.
@param [Hash{String => Object}] json
The parsed JSON.
@return [ProblemType]
The loaded problem-type object.
@api semipublic
# File lib/cve_schema/cve/problem_type.rb, line 50 def self.load(json) new(from_json(json)) end
new(description)
click to toggle source
Initializes the problem-type object.
@param [Array<Description>] description
# File lib/cve_schema/cve/problem_type.rb, line 20 def initialize(description) @description = description end