Class: Byebug::RemoteInterface

Inherits:
Interface show all
Defined in:
lib/byebug/interfaces/remote_interface.rb

Instance Attribute Summary collapse

Attributes inherited from Interface

#command_queue, #restart_file

Instance Method Summary collapse

Methods inherited from Interface

#errmsg, #escape, #format

Constructor Details

#initialize(socket) ⇒ RemoteInterface

Returns a new instance of RemoteInterface.



7
8
9
10
11
# File 'lib/byebug/interfaces/remote_interface.rb', line 7

def initialize(socket)
  super()
  @socket = socket
  @history = History.new
end

Instance Attribute Details

#historyObject (readonly)

Returns the value of attribute history.



5
6
7
# File 'lib/byebug/interfaces/remote_interface.rb', line 5

def history
  @history
end

Instance Method Details

#closeObject



13
14
15
16
# File 'lib/byebug/interfaces/remote_interface.rb', line 13

def close
  @socket.close
rescue IOError
end

#confirm(prompt) ⇒ Object



18
19
20
# File 'lib/byebug/interfaces/remote_interface.rb', line 18

def confirm(prompt)
  send_command "CONFIRM #{prompt}"
end


26
27
28
# File 'lib/byebug/interfaces/remote_interface.rb', line 26

def print(*args)
  @socket.printf(escape(format(*args)))
end

#read_command(prompt) ⇒ Object



22
23
24
# File 'lib/byebug/interfaces/remote_interface.rb', line 22

def read_command(prompt)
  send_command "PROMPT #{prompt}"
end