Module: NVD::JSONFeeds::Schema::CPE::HasURI::ClassMethods

Defined in:
lib/nvd/json_feeds/schema/cpe/has_uri.rb

Overview

Class methods.

Instance Method Summary collapse

Instance Method Details

#from_json(json) ⇒ Hash{Symbol => Object}

Maps the parsed JSON to a Symbol Hash for NVD::JSONFeeds::Schema::CPE::HasURI#initialize.

Parameters:

  • json (Hash{String => Object})

    The parsed JSON.

Returns:

  • (Hash{Symbol => Object})

    The Symbol Hash.



29
30
31
32
33
34
# File 'lib/nvd/json_feeds/schema/cpe/has_uri.rb', line 29

def from_json(json)
  {
    cpe23uri: json.fetch('cpe23Uri'),
    cpe22uri: json['cpe22Uri']
  }
end