Module: NVD::JSONFeeds::Schema::HasDataVersion::ClassMethods

Defined in:
lib/nvd/json_feeds/schema/has_data_version.rb

Overview

The 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::HasDataVersion#initialize.

Parameters:

  • json (Hash{String => Object})

    The parsed JSON.

Returns:

  • (Hash{Symbol => Object})

    The Symbol Hash.



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

def from_json(json)
  {
    data_version: DATA_VERSIONS.fetch(json.fetch('CVE_data_version'))
  }
end