Class: AbstractCommandResult
- Inherits:
-
Object
- Object
- AbstractCommandResult
- 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.
Direct Known Subclasses
AttachFileCommandResult, CheckFinishedCommandResult, CpeNameCommandResult, DataCommandResult, ListeningPortCommandResult, MessageCommandResult, ProgramNameCommandResult
Instance Attribute Summary collapse
-
#check ⇒ Object
readonly
Returns the value of attribute check.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(check, severity, message, type) ⇒ AbstractCommandResult
constructor
A new instance of AbstractCommandResult.
- #to_hash ⇒ Object
- #to_string ⇒ Object
- #visible? ⇒ Boolean
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, , type) @check = check @severity = severity @message = @type = type end |
Instance Attribute Details
#check ⇒ Object (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 |
#message ⇒ Object (readonly)
Returns the value of attribute message.
6 7 8 |
# File 'lib/audit/lib/parser/command/abstract_command_result.rb', line 6 def @message end |
#severity ⇒ Object (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 |
#type ⇒ Object (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_hash ⇒ Object
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_string ⇒ Object
16 17 18 |
# File 'lib/audit/lib/parser/command/abstract_command_result.rb', line 16 def to_string() return @message end |
#visible? ⇒ Boolean
27 28 29 |
# File 'lib/audit/lib/parser/command/abstract_command_result.rb', line 27 def visible? return true end |