Class: VirusTotal::Client::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/virustotal/clients/base.rb

Direct Known Subclasses

Domain, File, IPAddress, URL

Constant Summary collapse

HOST =
"www.virustotal.com"
VERSION =
"v2"
BASE_URL =
"https://#{HOST}/vtapi/#{VERSION}"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key: ENV["VIRUSTOTAL_API_KEY"]) ⇒ Base

Returns a new instance of Base.

Raises:

  • (ArgumentError)


16
17
18
19
# File 'lib/virustotal/clients/base.rb', line 16

def initialize(key: ENV["VIRUSTOTAL_API_KEY"])
  @key = key
  raise ArgumentError, "No key has been found or provided!" unless key?
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



14
15
16
# File 'lib/virustotal/clients/base.rb', line 14

def key
  @key
end