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