class Nexpose::Service

A service endpoint on an asset.

Attributes

name[R]

Name of the service. [Optional]

port[R]

Port on which the service is running.

protocol[R]

Protocol used to communicate to the port. @see Service::Protocol.

Public Class Methods

new(port = 0, protocol = Protocol::RAW, name = nil) click to toggle source
# File lib/nexpose/asset.rb, line 88
def initialize(port = 0, protocol = Protocol::RAW, name = nil)
  @port, @protocol, @name = port, protocol, name
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/nexpose/asset.rb, line 98
def <=>(other)
  c = port <=> other.port
  return c unless c.zero?
  c = protocol <=> other.protocol
  return c unless c.zero?
  name <=> other.name
end
==(other) click to toggle source
# File lib/nexpose/asset.rb, line 106
def ==(other)
  eql?(other)
end
eql?(other) click to toggle source
# File lib/nexpose/asset.rb, line 110
def eql?(other)
  port.eql?(other.port) && protocol.eql?(other.protocol) && name.eql?(other.name)
end
to_h() click to toggle source
# File lib/nexpose/asset.rb, line 92
def to_h
  { name: name,
    port: port,
    protocol: protocol }
end