Class: VirusTotal::API
- Inherits:
-
Object
- Object
- VirusTotal::API
- Defined in:
- lib/virustotal/api.rb
Instance Attribute Summary collapse
-
#key ⇒ String
readonly
VirusTotal API key.
Instance Method Summary collapse
-
#analysis ⇒ VirusTotal::Client::Analysis
Analyses API endpoint client.
-
#domain ⇒ VirusTotal::Client::Domain
Domains API endpoint client.
-
#file ⇒ VirusTotal::Client::File
Files API endpoint client.
-
#graph ⇒ VirusTotal::Client::Graph
Graphs API endpoint client.
-
#initialize(key: ENV["VIRUSTOTAL_API_KEY"]) ⇒ API
constructor
A new instance of API.
-
#ip_address ⇒ VirusTotal::Client::IPAddress
IP addresses API endpoint client.
-
#url ⇒ VirusTotal::Client::URL
URLs API endpoint client.
Constructor Details
#initialize(key: ENV["VIRUSTOTAL_API_KEY"]) ⇒ API
Returns a new instance of API.
13 14 15 16 17 |
# File 'lib/virustotal/api.rb', line 13 def initialize(key: ENV["VIRUSTOTAL_API_KEY"]) @key = key raise ArgumentError, "No API key has been found or provided! (setup your VIRUSTOTAL_API_KEY environment varialbe)" unless key end |
Instance Attribute Details
#key ⇒ String (readonly)
Returns VirusTotal API key.
6 7 8 |
# File 'lib/virustotal/api.rb', line 6 def key @key end |
Instance Method Details
#analysis ⇒ VirusTotal::Client::Analysis
Analyses API endpoint client
24 25 26 |
# File 'lib/virustotal/api.rb', line 24 def analysis @analysis ||= Client::Analysis.new(key: key) end |
#domain ⇒ VirusTotal::Client::Domain
Domains API endpoint client
33 34 35 |
# File 'lib/virustotal/api.rb', line 33 def domain @domain ||= Client::Domain.new(key: key) end |
#file ⇒ VirusTotal::Client::File
Files API endpoint client
42 43 44 |
# File 'lib/virustotal/api.rb', line 42 def file @file ||= Client::File.new(key: key) end |
#graph ⇒ VirusTotal::Client::Graph
Graphs API endpoint client
69 70 71 |
# File 'lib/virustotal/api.rb', line 69 def graph @graph ||= Client::Graph.new(key: key) end |
#ip_address ⇒ VirusTotal::Client::IPAddress
IP addresses API endpoint client
51 52 53 |
# File 'lib/virustotal/api.rb', line 51 def ip_address @ip_address ||= Client::IPAddress.new(key: key) end |
#url ⇒ VirusTotal::Client::URL
URLs API endpoint client
60 61 62 |
# File 'lib/virustotal/api.rb', line 60 def url @url ||= Client::URL.new(key: key) end |