Class: Einhorn::Client
- Inherits:
-
Object
- Object
- Einhorn::Client
- Defined in:
- lib/einhorn/client.rb
Defined Under Namespace
Modules: Transport
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(socket) ⇒ Client
constructor
A new instance of Client.
- #receive_message ⇒ Object
- #send_command(command_hash) ⇒ Object
Constructor Details
#initialize(socket) ⇒ Client
Returns a new instance of Client.
44 45 46 |
# File 'lib/einhorn/client.rb', line 44 def initialize(socket) @socket = socket end |
Class Method Details
.for_fd(fileno) ⇒ Object
39 40 41 42 |
# File 'lib/einhorn/client.rb', line 39 def self.for_fd(fileno) socket = UNIXSocket.for_fd(fileno) new(socket) end |
.for_path(path_to_socket) ⇒ Object
34 35 36 37 |
# File 'lib/einhorn/client.rb', line 34 def self.for_path(path_to_socket) socket = UNIXSocket.open(path_to_socket) new(socket) end |
Instance Method Details
#close ⇒ Object
56 57 58 |
# File 'lib/einhorn/client.rb', line 56 def close @socket.close end |
#receive_message ⇒ Object
52 53 54 |
# File 'lib/einhorn/client.rb', line 52 def Transport.(@socket) end |
#send_command(command_hash) ⇒ Object
48 49 50 |
# File 'lib/einhorn/client.rb', line 48 def send_command(command_hash) Transport.(@socket, command_hash) end |