Class: VirusTotal::API
- Inherits:
-
Object
- Object
- VirusTotal::API
- Defined in:
- lib/virustotal/api.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#ip_address ⇒ Object
readonly
Returns the value of attribute ip_address.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(key: ENV["VIRUSTOTAL_API_KEY"]) ⇒ API
constructor
A new instance of API.
Constructor Details
#initialize(key: ENV["VIRUSTOTAL_API_KEY"]) ⇒ API
Returns a new instance of API.
12 13 14 15 16 17 18 19 |
# File 'lib/virustotal/api.rb', line 12 def initialize(key: ENV["VIRUSTOTAL_API_KEY"]) raise ArgumentError, "No API key has been found or provided! (setup your VIRUSTOTAL_API_KEY environment varialbe)" unless key @domain = Client::Domain.new(key: key) @file = Client::File.new(key: key) @ip_address = Client::IPAddress.new(key: key) @url = Client::URL.new(key: key) end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
7 8 9 |
# File 'lib/virustotal/api.rb', line 7 def domain @domain end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
8 9 10 |
# File 'lib/virustotal/api.rb', line 8 def file @file end |
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
9 10 11 |
# File 'lib/virustotal/api.rb', line 9 def ip_address @ip_address end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
10 11 12 |
# File 'lib/virustotal/api.rb', line 10 def url @url end |