Class: VirusTotal::Client::Base
- Inherits:
-
Object
- Object
- VirusTotal::Client::Base
- Defined in:
- lib/virustotal/clients/base.rb
Constant Summary collapse
- HOST =
"www.virustotal.com"- VERSION =
"v3"- BASE_URL =
"https://#{HOST}/api/#{VERSION}"- CONVERT_TABLE =
{ analysis: "analyses", domain: "domains", file: "files", graph: "graphs", ipaddress: "ip_addresses", url: "urls", }.freeze
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(key: ENV["VIRUSTOTAL_API_KEY"]) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(key: ENV["VIRUSTOTAL_API_KEY"]) ⇒ Base
Returns a new instance of Base.
25 26 27 28 |
# File 'lib/virustotal/clients/base.rb', line 25 def initialize(key: ENV["VIRUSTOTAL_API_KEY"]) @key = key raise ArgumentError, "No key has been found or provided!" unless key? end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
23 24 25 |
# File 'lib/virustotal/clients/base.rb', line 23 def key @key end |