class VtApi::Versions::ApiV2

VirusTotal Public API 2.0 singleton interface. Describes all available API methods (endpoints).

Constants

BASE_URI

Root URI for all endpoints.

ENDPOINTS

VirusTotal Public API v2.0 interface description.

ERRORS

List of possible HTTP error codes with descriptions

Public Class Methods

instance() click to toggle source

Get interface instance.

@return [VtApi::Versions::ApiV2]

# File lib/vt_api/internal/versions/api_v2.rb, line 60
def instance
        @instance ||= new
end

Public Instance Methods

base_url() click to toggle source

API base URL.

@return [String]

# File lib/vt_api/internal/versions/api_v2.rb, line 100
def base_url
        BASE_URI
end
endpoint(method) click to toggle source

Get API method endpoint interface.

@param [String] method API method name to be called. @return [VtApi::Endpoint]

# File lib/vt_api/internal/versions/api_v2.rb, line 69
def endpoint(method)
        ENDPOINTS[method.to_sym] unless ENDPOINTS[method.to_sym].nil?
end
endpoint?(method) click to toggle source

Check whether given method is defined in interface.

@param [String] method Method name. @return [Boolean]

# File lib/vt_api/internal/versions/api_v2.rb, line 77
def endpoint?(method)
        !endpoint(method).nil?
end
error(http_code) click to toggle source

Get API HTTP-code description.

@param [Integer] http_code @return [String] Error description.

# File lib/vt_api/internal/versions/api_v2.rb, line 85
def error(http_code)
        ERRORS[http_code] unless ERRORS[http_code].nil?
end
error?(http_code) click to toggle source

Check whether API HTTP-code means error.

@param [Integer] http_code @return [Boolean] Error description.

# File lib/vt_api/internal/versions/api_v2.rb, line 93
def error?(http_code)
        !error(http_code).nil?
end
version() click to toggle source

API interface name/version.

@return [String]

# File lib/vt_api/internal/versions/api_v2.rb, line 107
def version
        'VTAPI-2.0'
end