Class: GoogleDriveCompanion::Socket

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/google_drive_companion/socket.rb

Instance Method Summary collapse

Instance Method Details

#closeObject



18
19
20
# File 'lib/google_drive_companion/socket.rb', line 18

def close
  socket.close
end

#digest(msg) ⇒ Object



22
23
24
25
# File 'lib/google_drive_companion/socket.rb', line 22

def digest(msg)
  socket.send(msg.to_json, 0)
  socket.recv(10_000)
end

#socketObject



14
15
16
# File 'lib/google_drive_companion/socket.rb', line 14

def socket
  @socket ||= UNIXSocket.open(socket_file)
end

#socket_fileObject



10
11
12
# File 'lib/google_drive_companion/socket.rb', line 10

def socket_file
  ENV["gdc_socket"] || File.join("", "tmp", "gdc_socket.sock")
end