Class: Clamrb::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/clamrb/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, identifier = nil) ⇒ Result

Returns a new instance of Result.



5
6
7
# File 'lib/clamrb/result.rb', line 5

def initialize(status, identifier = nil)
  @status, @identifier = status, identifier
end

Instance Attribute Details

#identifierObject

Returns the value of attribute identifier.



3
4
5
# File 'lib/clamrb/result.rb', line 3

def identifier
  @identifier
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/clamrb/result.rb', line 3

def status
  @status
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/clamrb/result.rb', line 17

def error?
  status == :unknown
end

#safe?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/clamrb/result.rb', line 9

def safe?
  status != :infected
end

#virus?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/clamrb/result.rb', line 13

def virus?
  status == :infected
end