Sha256: 993ae85b67f03614bd640310666e7cba3c907a4cbd7d834ad2368b0e0f531ce1

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

module RubyClamdscan
  module Models
    # Represents the result from scanning a file with ClamAV
    class ScanResult
      # If the command successfully - does not indicate file was safe! Check contains_virus for that information
      # @return [Boolean]
      attr_reader :is_successful

      # If ClamAV detected malware in the passed file, will be nil if there was an error running the command
      # @return [Boolean, nil]
      attr_reader :contains_virus

      # Returns the error string if the command failed
      # @return [Exception, nil]
      attr_reader :exception

      # Returns the error string if the command failed
      # @return [String, nil]
      attr_reader :error_message

      # Returns virus information if a virus was detected
      # Value is the response from ClamAV, the malware classification - should be in the form of "Win.Test.EICAR_HDB-1"
      # @return [String, nil]
      attr_reader :virus_info

      def initialize(is_successful:, contains_virus:, virus_info: nil, exception: nil, error_message: nil)
        @is_successful = is_successful
        @contains_virus = contains_virus
        @exception = exception
        @error_message = error_message
        @virus_info = virus_info
      end
    end

    class StatsResult
      attr_reader :total_pools, :state, :threads_live, :threads_idle, :threads_max
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby_clamdscan-0.1.3 lib/ruby_clamdscan/models/scan_result.rb
ruby_clamdscan-0.1.2 lib/ruby_clamdscan/models/scan_result.rb
ruby_clamdscan-0.1.1 lib/ruby_clamdscan/models/scan_result.rb
ruby_clamdscan-0.1.0 lib/ruby_clamdscan/models/scan_result.rb