Class: Inspec::Resources::Port
- Inherits:
-
Object
- Object
- Inspec::Resources::Port
- Defined in:
- lib/resources/port.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ Port
constructor
A new instance of Port.
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ Port
Returns a new instance of Port.
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/resources/port.rb', line 27 def initialize(*args) args.unshift(nil) if args.length <= 1 # add the ip address to the front @ip = args[0] @port = if args[1].nil? nil else args[1].to_i end @cache = nil @port_manager = port_manager_for_os return skip_resource 'The `port` resource is not supported on your OS yet.' if @port_manager.nil? end |
Instance Method Details
#to_s ⇒ Object
50 51 52 |
# File 'lib/resources/port.rb', line 50 def to_s "Port #{@port}" end |