Class: VirusTotal::API
- Inherits:
-
Object
- Object
- VirusTotal::API
- Defined in:
- lib/virustotal/api.rb
Instance Attribute Summary collapse
-
#analysis ⇒ Object
readonly
Returns the value of attribute analysis.
-
#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.
13 14 15 16 17 18 19 20 21 |
# File 'lib/virustotal/api.rb', line 13 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 @analysis = Client::Analysis.new(key: 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
#analysis ⇒ Object (readonly)
Returns the value of attribute analysis.
7 8 9 |
# File 'lib/virustotal/api.rb', line 7 def analysis @analysis end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
8 9 10 |
# File 'lib/virustotal/api.rb', line 8 def domain @domain end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
9 10 11 |
# File 'lib/virustotal/api.rb', line 9 def file @file end |
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
10 11 12 |
# File 'lib/virustotal/api.rb', line 10 def ip_address @ip_address end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
11 12 13 |
# File 'lib/virustotal/api.rb', line 11 def url @url end |