Class: AbstractCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/audit/lib/parser/command/abstract_command.rb

Overview

The superclass for all response commands from scripts each subclass must have a constant named COMMAND, which is the string version of the command as sent by the worker script

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(check, severity, message) ⇒ AbstractCommand

Create a new AbstractCommand. Should only be called from subclasses, as this class is abstract,

  • check

  • severity

  • message



17
18
19
20
21
# File 'lib/audit/lib/parser/command/abstract_command.rb', line 17

def initialize(check, severity, message)
  @check = check
  @severity = severity
  @message = message
end

Instance Attribute Details

#checkObject (readonly)

The check that issued this command.



6
7
8
# File 'lib/audit/lib/parser/command/abstract_command.rb', line 6

def check
  @check
end

#messageObject (readonly)

The message associated with this command.



10
11
12
# File 'lib/audit/lib/parser/command/abstract_command.rb', line 10

def message
  @message
end

#severityObject (readonly)

The severity of this command.



8
9
10
# File 'lib/audit/lib/parser/command/abstract_command.rb', line 8

def severity
  @severity
end

Instance Method Details

#process(parser) ⇒ Object

Abstract method to be implemented by subclasses. Perform any action neccessary to obtain results, like copying a file to the local host.



25
26
# File 'lib/audit/lib/parser/command/abstract_command.rb', line 25

def process(parser)
end

#resultObject

Abstract method to be implemented by subclasses. return a result object, contained in an instance of kind AbstractCommandResult



30
31
# File 'lib/audit/lib/parser/command/abstract_command.rb', line 30

def result()
end