class NVD::JSONFeeds::Schema::CPE::Match
Represents the `“cpe_match”` value.
Attributes
cpe_name[R]
@return [Array<Name>]
version_end_excluding[R]
@return [String, nil]
version_end_including[R]
@return [String, nil]
version_start_excluding[R]
@return [String, nil]
version_start_including[R]
@return [String, nil]
vulnerable[R]
@return [Boolean]
Public Class Methods
from_json(json)
click to toggle source
Maps the CPE
match JSON to a Symbol Hash for {#initialize}.
@param [Hash{String => Object}] json
The parsed JSON.
@return [Hash{Symbol => Object}]
The mapped Symbol Hash.
Calls superclass method
# File lib/nvd/json_feeds/schema/cpe/match.rb, line 84 def self.from_json(json) { vulnerable: json.fetch('vulnerable'), **super(json), version_start_excluding: json['versionStartExcluding'], version_start_including: json['versionStartIncluding'], version_end_excluding: json['versionEndExcluding'], version_end_including: json['versionEndIncluding'], cpe_name: Array(json['cpe_name']).map(&Name.method(:load)) } end
load(json)
click to toggle source
Loads the CPE
match object from the parsed JSON.
@param [Hash{String => Object}] json
The parsed JSON.
@return [Match]
The loaded CPE match object.
# File lib/nvd/json_feeds/schema/cpe/match.rb, line 109 def self.load(json) new(**from_json(json)) end
new(vulnerable: , version_start_excluding: nil, version_start_including: nil, version_end_excluding: nil, version_end_including: nil, cpe_name: [], **kwargs)
click to toggle source
Initializes the CPE
match object.
@param [Boolean] vulnerable
@param [String, nil] version_start_excluding
@param [String, nil] version_start_including
@param [String, nil] version_end_excluding
@param [String, nil] version_end_including
@param [Array<Name>] cpe_name
Calls superclass method
NVD::JSONFeeds::Schema::CPE::HasURI::new
# File lib/nvd/json_feeds/schema/cpe/match.rb, line 47 def initialize(vulnerable: , version_start_excluding: nil, version_start_including: nil, version_end_excluding: nil, version_end_including: nil, cpe_name: [], **kwargs) super(**kwargs) @vulnerable = vulnerable @version_start_excluding = version_start_excluding @version_start_including = version_start_including @version_end_excluding = version_end_excluding @version_end_including = version_end_including @cpe_name = cpe_name end
Public Instance Methods
vulnerable?()
click to toggle source
Determines if the CPE
match indicates whether it's vulnerable.
@return [Boolean]
# File lib/nvd/json_feeds/schema/cpe/match.rb, line 71 def vulnerable? @vulnerable == true end