Sha256: cada3d58eb52c4ea35f2c86dc0a902ec7cda6ec4d7cc6d1f165cdc9f60419ffa

Contents?: true

Size: 822 Bytes

Versions: 7

Compression:

Stored size: 822 Bytes

Contents

module Ddr::Antivirus
  #
  # The result of a virus scan.
  #
  class ScanResult

    attr_reader :file_path, :output, :scanned_at, :version

    def initialize(file_path, output, scanned_at: nil, version: nil)
      @file_path  = file_path
      @output     = output
      @scanned_at = scanned_at || default_time
      @version    = version    || default_version
    end

    # Default time of virus scan - i.e., now.
    # @return [Time] the time.
    def default_time
      Time.now.utc
    end

    # Default anti-virus software version information.
    # @return [String] the version.
    def default_version
      "ddr-antivirus #{Ddr::Antivirus::VERSION}"
    end

    # String representation of the result
    # @return [String] the representation.
    def to_s
      "#{output}\n[#{version}]"
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ddr-antivirus-3.0.0 lib/ddr/antivirus/scan_result.rb
ddr-antivirus-3.0.0.rc1 lib/ddr/antivirus/scan_result.rb
ddr-antivirus-2.2.0 lib/ddr/antivirus/scan_result.rb
ddr-antivirus-2.1.1 lib/ddr/antivirus/scan_result.rb
ddr-antivirus-2.0.0 lib/ddr/antivirus/scan_result.rb
ddr-antivirus-2.0.0.rc2 lib/ddr/antivirus/scan_result.rb
ddr-antivirus-2.0.0.rc1 lib/ddr/antivirus/scan_result.rb