Class: ListeningPortCommandResult
- Inherits:
-
AbstractCommandResult
- Object
- AbstractCommandResult
- ListeningPortCommandResult
- Defined in:
- lib/audit/lib/parser/command/listening_port_command.rb
Instance Attribute Summary collapse
-
#interface ⇒ Object
readonly
Returns the value of attribute interface.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#process ⇒ Object
readonly
Returns the value of attribute process.
Attributes inherited from AbstractCommandResult
#check, #message, #severity, #type
Instance Method Summary collapse
-
#initialize(check, severity, message, port, interface, process) ⇒ ListeningPortCommandResult
constructor
A new instance of ListeningPortCommandResult.
- #to_hash ⇒ Object
- #to_string ⇒ Object
Methods inherited from AbstractCommandResult
Constructor Details
#initialize(check, severity, message, port, interface, process) ⇒ ListeningPortCommandResult
Returns a new instance of ListeningPortCommandResult.
13 14 15 16 17 18 |
# File 'lib/audit/lib/parser/command/listening_port_command.rb', line 13 def initialize(check, severity, , port, interface, process) super(check, severity, || "found open port", ResultType::LISTENING_PORT) @port = port @process = process @interface = interface end |
Instance Attribute Details
#interface ⇒ Object (readonly)
Returns the value of attribute interface.
11 12 13 |
# File 'lib/audit/lib/parser/command/listening_port_command.rb', line 11 def interface @interface end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
9 10 11 |
# File 'lib/audit/lib/parser/command/listening_port_command.rb', line 9 def port @port end |
#process ⇒ Object (readonly)
Returns the value of attribute process.
10 11 12 |
# File 'lib/audit/lib/parser/command/listening_port_command.rb', line 10 def process @process end |
Instance Method Details
#to_hash ⇒ Object
24 25 26 27 28 |
# File 'lib/audit/lib/parser/command/listening_port_command.rb', line 24 def to_hash() return super.to_hash().merge({:port => @port, :process => @process, :interface => @interface}) end |
#to_string ⇒ Object
20 21 22 |
# File 'lib/audit/lib/parser/command/listening_port_command.rb', line 20 def to_string() return "#{@message}: #{@port} on interface #{@interface} of process #{@process}" end |