Class: Ddr::Antivirus::ScanResult
- Inherits:
-
Object
- Object
- Ddr::Antivirus::ScanResult
- Defined in:
- lib/ddr/antivirus/scan_result.rb
Overview
The result of a virus scan.
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#scanned_at ⇒ Object
readonly
Returns the value of attribute scanned_at.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#default_time ⇒ Time
Default time of virus scan - i.e., now.
-
#default_version ⇒ String
Default anti-virus software version information.
-
#initialize(file_path, output, scanned_at: nil, version: nil) ⇒ ScanResult
constructor
A new instance of ScanResult.
-
#to_s ⇒ String
String representation of the result.
Constructor Details
#initialize(file_path, output, scanned_at: nil, version: nil) ⇒ ScanResult
Returns a new instance of ScanResult.
9 10 11 12 13 14 |
# File 'lib/ddr/antivirus/scan_result.rb', line 9 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 |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
7 8 9 |
# File 'lib/ddr/antivirus/scan_result.rb', line 7 def file_path @file_path end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
7 8 9 |
# File 'lib/ddr/antivirus/scan_result.rb', line 7 def output @output end |
#scanned_at ⇒ Object (readonly)
Returns the value of attribute scanned_at.
7 8 9 |
# File 'lib/ddr/antivirus/scan_result.rb', line 7 def scanned_at @scanned_at end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
7 8 9 |
# File 'lib/ddr/antivirus/scan_result.rb', line 7 def version @version end |
Instance Method Details
#default_time ⇒ Time
Default time of virus scan - i.e., now.
18 19 20 |
# File 'lib/ddr/antivirus/scan_result.rb', line 18 def default_time Time.now.utc end |
#default_version ⇒ String
Default anti-virus software version information.
24 25 26 |
# File 'lib/ddr/antivirus/scan_result.rb', line 24 def default_version "ddr-antivirus #{Ddr::Antivirus::VERSION}" end |
#to_s ⇒ String
String representation of the result
30 31 32 |
# File 'lib/ddr/antivirus/scan_result.rb', line 30 def to_s "#{output}\n[#{version}]" end |