Class: CheckFinishedCommandResult

Inherits:
AbstractCommandResult show all
Defined in:
lib/audit/lib/parser/command/check_finished_command.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractCommandResult

#check, #message, #severity, #type

Instance Method Summary collapse

Constructor Details

#initialize(check, severity, message, exit_code) ⇒ CheckFinishedCommandResult

Returns a new instance of CheckFinishedCommandResult.



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

def initialize(check, severity, message, exit_code)
  super(check, severity, message, ResultType::CHECK_FINISHED)
  @exit_code = exit_code
end

Instance Attribute Details

#exit_codeObject (readonly)

Returns the value of attribute exit_code.



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

def exit_code
  @exit_code
end

Instance Method Details

#to_hashObject



23
24
25
# File 'lib/audit/lib/parser/command/check_finished_command.rb', line 23

def to_hash()
  return super.to_hash().merge({:exit_code => @exit_code})
end

#to_stringObject



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

def to_string()
  if message then
    return "Check #{@check.id} finished: #{@message}"
  else
    return "Check #{@check.id} has finished"
  end
end

#visible?Boolean

Returns:

  • (Boolean)


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

def visible?
  return false
end