Class: Cline::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/cline/client.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Client

Returns a new instance of Client.



12
13
14
# File 'lib/cline/client.rb', line 12

def initialize(args)
  @args = args
end

Class Method Details

.start(args) ⇒ Object



8
9
10
# File 'lib/cline/client.rb', line 8

def self.start(args)
  new(args).invoke
end

Instance Method Details

#invokeObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/cline/client.rb', line 16

def invoke
  $stdout.sync = true

  UNIXSocket.open Server.socket_file.to_path do |socket|
    socket.puts @args.to_json

    while line = socket.gets
      puts line
    end
  end
end