Class: AbstractCommandResult

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

Overview

To change this template, choose Tools | Templates and open the template in the editor.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(check, severity, message, type) ⇒ AbstractCommandResult

Returns a new instance of AbstractCommandResult.



9
10
11
12
13
14
# File 'lib/audit/lib/parser/command/abstract_command_result.rb', line 9

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

Instance Attribute Details

#checkObject (readonly)

Returns the value of attribute check.



4
5
6
# File 'lib/audit/lib/parser/command/abstract_command_result.rb', line 4

def check
  @check
end

#messageObject (readonly)

Returns the value of attribute message.



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

def message
  @message
end

#severityObject (readonly)

Returns the value of attribute severity.



5
6
7
# File 'lib/audit/lib/parser/command/abstract_command_result.rb', line 5

def severity
  @severity
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/audit/lib/parser/command/abstract_command_result.rb', line 7

def type
  @type
end

Instance Method Details

#to_hashObject



20
21
22
23
24
25
# File 'lib/audit/lib/parser/command/abstract_command_result.rb', line 20

def to_hash()
  return {:rule => @check.id,
          :severity => @severity,
          :message => @message,
          :type => @type}
end

#to_stringObject



16
17
18
# File 'lib/audit/lib/parser/command/abstract_command_result.rb', line 16

def to_string()
  return @message
end

#visible?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/audit/lib/parser/command/abstract_command_result.rb', line 27

def visible?
  return true
end