Class: CpeNameCommandResult

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

Instance Attribute Summary

Attributes inherited from AbstractCommandResult

#check, #message, #severity, #type

Instance Method Summary collapse

Methods inherited from AbstractCommandResult

#visible?

Constructor Details

#initialize(check, severity, message, cpe_name) ⇒ CpeNameCommandResult

Returns a new instance of CpeNameCommandResult.



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

def initialize(check, severity, message, cpe_name)
  super(check, severity, message || "found program", ResultType::CPE_NAME)
  @cpe_name = cpe_name
end

Instance Method Details

#get_cpe_nameObject



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

def get_cpe_name()
  return @cpe_name
end

#to_hashObject



19
20
21
# File 'lib/audit/lib/parser/command/cpe_name_command.rb', line 19

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

#to_stringObject



15
16
17
# File 'lib/audit/lib/parser/command/cpe_name_command.rb', line 15

def to_string()
  return "#{@message}: #{@cpe_name}"
end