Class: ListeningPortCommand
- Inherits:
-
AbstractCommand
- Object
- AbstractCommand
- ListeningPortCommand
- Defined in:
- lib/audit/lib/parser/command/listening_port_command.rb
Constant Summary collapse
- COMMAND =
"OPEN_PORT"
Instance Attribute Summary
Attributes inherited from AbstractCommand
Instance Method Summary collapse
-
#initialize(check, severity, args) ⇒ ListeningPortCommand
constructor
A new instance of ListeningPortCommand.
- #result ⇒ Object
Methods inherited from AbstractCommand
Constructor Details
#initialize(check, severity, args) ⇒ ListeningPortCommand
Returns a new instance of ListeningPortCommand.
34 35 36 37 38 39 40 41 |
# File 'lib/audit/lib/parser/command/listening_port_command.rb', line 34 def initialize(check, severity, args) @port = args[0].to_i if (args.length >= 1 and /^[0-9]+$/.match(args[0])) or raise ParseException "#{COMMAND} did not supply the port argument: '#{text}'" @process = (args[1] if args.length >= 2) || "" @interface = (args[2] if args.length >= 3) || "" = args[3 .. -1].join if args.length >= 4 super(check, severity, ) end |
Instance Method Details
#result ⇒ Object
43 44 45 |
# File 'lib/audit/lib/parser/command/listening_port_command.rb', line 43 def result() return ListeningPortCommandResult.new(@check, @severity, @message, @port, @interface, @process) end |