Class: CVESchema::CVE::ProblemType
- Inherits:
-
Object
- Object
- CVESchema::CVE::ProblemType
- Defined in:
- lib/cve_schema/cve/problem_type.rb
Overview
Represents an element within the "problemtype_data"
JSON Array.
Instance Attribute Summary collapse
- #description ⇒ Array<Description> (also: #descriptions) readonly
Class Method Summary collapse
-
.from_json(json) ⇒ Array<Description>
Maps the parsed JSON to an Array of Description objects for #initialize.
-
.load(json) ⇒ ProblemType
Loads the problem-type object from parsed JSON.
Instance Method Summary collapse
-
#initialize(description) ⇒ ProblemType
constructor
Initializes the problem-type object.
Constructor Details
#initialize(description) ⇒ ProblemType
Initializes the problem-type object.
20 21 22 |
# File 'lib/cve_schema/cve/problem_type.rb', line 20 def initialize(description) @description = description end |
Instance Attribute Details
#description ⇒ Array<Description> (readonly) Also known as: descriptions
11 12 13 |
# File 'lib/cve_schema/cve/problem_type.rb', line 11 def description @description end |
Class Method Details
.from_json(json) ⇒ Array<Description>
Maps the parsed JSON to an Array of Description objects for #initialize.
35 36 37 |
# File 'lib/cve_schema/cve/problem_type.rb', line 35 def self.from_json(json) json['description'].map(&Description.method(:load)) end |
.load(json) ⇒ ProblemType
Loads the problem-type object from parsed JSON.
50 51 52 |
# File 'lib/cve_schema/cve/problem_type.rb', line 50 def self.load(json) new(from_json(json)) end |