Class: ProgramNameCommandResult
- Inherits:
-
AbstractCommandResult
- Object
- AbstractCommandResult
- ProgramNameCommandResult
- Defined in:
- lib/audit/lib/parser/command/program_name_command.rb
Instance Attribute Summary collapse
-
#program_name ⇒ Object
readonly
Returns the value of attribute program_name.
-
#program_version ⇒ Object
readonly
Returns the value of attribute program_version.
Attributes inherited from AbstractCommandResult
#check, #message, #severity, #type
Instance Method Summary collapse
-
#initialize(check, severity, message, name, version) ⇒ ProgramNameCommandResult
constructor
A new instance of ProgramNameCommandResult.
- #to_hash ⇒ Object
- #to_string ⇒ Object
Methods inherited from AbstractCommandResult
Constructor Details
#initialize(check, severity, message, name, version) ⇒ ProgramNameCommandResult
Returns a new instance of ProgramNameCommandResult.
9 10 11 12 13 |
# File 'lib/audit/lib/parser/command/program_name_command.rb', line 9 def initialize(check, severity, , name, version) super(check, severity, || "program found", ResultType::PROGRAM_NAME) @program_name = name @program_version = version end |
Instance Attribute Details
#program_name ⇒ Object (readonly)
Returns the value of attribute program_name.
6 7 8 |
# File 'lib/audit/lib/parser/command/program_name_command.rb', line 6 def program_name @program_name end |
#program_version ⇒ Object (readonly)
Returns the value of attribute program_version.
7 8 9 |
# File 'lib/audit/lib/parser/command/program_name_command.rb', line 7 def program_version @program_version end |
Instance Method Details
#to_hash ⇒ Object
23 24 25 |
# File 'lib/audit/lib/parser/command/program_name_command.rb', line 23 def to_hash() return super.to_hash().merge({:program_name => @program_name, :program_version => @program_version}) end |
#to_string ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/audit/lib/parser/command/program_name_command.rb', line 15 def to_string() if @message then return "#{@message}: #{@program_name} #{@program_version}" else return "#{@program_name} #{@program_version}" end end |