Class: GoogleDriveCompanion::Socket
- Inherits:
-
Object
- Object
- GoogleDriveCompanion::Socket
- Includes:
- Singleton
- Defined in:
- lib/google_drive_companion/socket.rb
Instance Method Summary collapse
Instance Method Details
#close ⇒ Object
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 |
#socket ⇒ Object
14 15 16 |
# File 'lib/google_drive_companion/socket.rb', line 14 def socket @socket ||= UNIXSocket.open(socket_file) end |
#socket_file ⇒ Object
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 |