Class: Inspec::Resources::Port

Inherits:
Object
  • Object
show all
Defined in:
lib/resources/port.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Port

Returns a new instance of Port.



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/resources/port.rb', line 36

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_sObject



61
62
63
# File 'lib/resources/port.rb', line 61

def to_s
  "Port #{@port}"
end