class NVD::JSONFeeds::Schema::CPE::Name
Represents the `“cpe_name”` value.
Attributes
last_modified_date[R]
Last modified date.
@return [DateTime, nil]
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 Hash.
@return [Hash{Symbol => Object}]
The mapped Symbol Hash.
Calls superclass method
# File lib/nvd/json_feeds/schema/cpe/name.rb, line 40 def self.from_json(json) { **super(json), last_modified_date: if (last_modified_date = json['lastModifiedDate']) Timestamp.parse(last_modified_date) end } end
load(json)
click to toggle source
Loads the CPE
name object from the parsed JSON.
@param [Hash{String => Object}] json
The parsed JSON Hash.
@return [Name]
The loaded CPE name object.
# File lib/nvd/json_feeds/schema/cpe/name.rb, line 59 def self.load(json) new(**from_json(json)) end
new(last_modified_date: nil, **kwargs)
click to toggle source
Initializes the CPE
name.
@param [DateTime, nil] last_modified_date
Calls superclass method
NVD::JSONFeeds::Schema::CPE::HasURI::new
# File lib/nvd/json_feeds/schema/cpe/name.rb, line 25 def initialize(last_modified_date: nil, **kwargs) super(**kwargs) @last_modified_date = last_modified_date end