Class: Contrast::Api::Communication::UnixSocket

Inherits:
Object
  • Object
show all
Includes:
Socket
Defined in:
lib/contrast/api/communication/unix_socket.rb

Overview

Implements a UNIX domain socket to connect to the Contrast Service.

Constant Summary

Constants included from Socket

Socket::SOCKET_MONITOR

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Socket

#send_marshaled

Constructor Details

#initialize(path) ⇒ UnixSocket

Create the socket

Parameters:

  • path (String)

    file path to a UNIX domain socket



17
18
19
# File 'lib/contrast/api/communication/unix_socket.rb', line 17

def initialize path
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



13
14
15
# File 'lib/contrast/api/communication/unix_socket.rb', line 13

def path
  @path
end

Instance Method Details

#new_socketObject



21
22
23
# File 'lib/contrast/api/communication/unix_socket.rb', line 21

def new_socket
  ::UNIXSocket.new(path)
end