Class: NVD::JSONFeeds::Schema::CPE::Name
- Inherits:
-
Object
- Object
- NVD::JSONFeeds::Schema::CPE::Name
- Includes:
- HasURI
- Defined in:
- lib/nvd/json_feeds/schema/cpe/name.rb
Overview
Represents the "cpe_name"
value.
Instance Attribute Summary collapse
-
#last_modified_date ⇒ DateTime?
readonly
Last modified date.
Attributes included from HasURI
Class Method Summary collapse
-
.from_json(json) ⇒ Hash{Symbol => Object}
Maps the parsed JSON to a Symbol Hash for #initialize.
-
.load(json) ⇒ Name
Loads the CPE name object from the parsed JSON.
Instance Method Summary collapse
-
#initialize(last_modified_date: nil, **kwargs) ⇒ Name
constructor
Initializes the CPE name.
Methods included from HasURI
Constructor Details
#initialize(last_modified_date: nil, **kwargs) ⇒ Name
Initializes the CPE name.
25 26 27 28 29 |
# 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 |
Instance Attribute Details
#last_modified_date ⇒ DateTime? (readonly)
Last modified date.
18 19 20 |
# File 'lib/nvd/json_feeds/schema/cpe/name.rb', line 18 def last_modified_date @last_modified_date end |
Class Method Details
.from_json(json) ⇒ Hash{Symbol => Object}
Maps the parsed JSON to a Symbol Hash for #initialize.
40 41 42 43 44 45 46 47 48 |
# 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) ⇒ Name
Loads the CPE name object from the parsed JSON.
59 60 61 |
# File 'lib/nvd/json_feeds/schema/cpe/name.rb', line 59 def self.load(json) new(**from_json(json)) end |