Class: Ddr::Antivirus::ScannerAdapter Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/ddr/antivirus/scanner_adapter.rb

Overview

This class is abstract.

Subclass and override #scan to implement a scanner adapter.

Direct Known Subclasses

ClamdScannerAdapter, NullScannerAdapter

Instance Method Summary collapse

Instance Method Details

#configObject

Return the adapter configuration options



18
19
20
# File 'lib/ddr/antivirus/scanner_adapter.rb', line 18

def config
  Ddr::Antivirus.adapter_config
end

#scan(path) ⇒ Ddr::Antivirus::Adapters::ScanResult

Scan a file path for viruses.

Parameters:

  • path (String)

    file path to scan.

Returns:

  • (Ddr::Antivirus::Adapters::ScanResult)

    the result of the scan.

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/ddr/antivirus/scanner_adapter.rb', line 13

def scan(path)
  raise NotImplementedError, "Adapters must implement the `scan' method."
end