Method: Nmap::Command::PortRange#format

Defined in:
lib/nmap/command.rb

#format(value) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Formats the given port or port range value.

Parameters:

  • The port or port range value to format.

Returns:

  • The formatted port or port range.

API:

  • private



318
319
320
321
322
323
324
325
# File 'lib/nmap/command.rb', line 318

def format(value)
  case value
  when Range
    "#{value.begin}-#{value.end}"
  else
    super(value)
  end
end