misc_rbtools/classes/nvd_client.rb

18 lines
421 B
Ruby

#require '../modules/nvd_tools'
require 'rest-client'
module NvdTools
class NvdClient
attr_accessor :version, :base_url, :type, :rest_client
def initialize(rest_client: RestClient)
@version = "1.0"
@base_url = "https://nvd.nist.gov/feeds/json/cve/#{version}/"
@type = type
@rest_client = rest_client
end
def get(url)
rest_client.get "#{base_url}#{url}"
end
end
end