Class: Byebug::RemoteInterface

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

Overview

Interface class for remote use of byebug.

Instance Attribute Summary collapse

Attributes inherited from Interface

#command_queue, #restart_file

Instance Method Summary collapse

Methods inherited from Interface

#errmsg

Constructor Details

#initialize(socket) ⇒ RemoteInterface

Returns a new instance of RemoteInterface.



10
11
12
13
14
# File 'lib/byebug/interfaces/remote_interface.rb', line 10

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

Instance Attribute Details

#historyObject (readonly)

Returns the value of attribute history.



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

def history
  @history
end

Instance Method Details

#closeObject



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

def close
  @socket.close
rescue IOError
end

#confirm(prompt) ⇒ Object



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

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

#puts(message) ⇒ Object



29
30
31
# File 'lib/byebug/interfaces/remote_interface.rb', line 29

def puts(message)
  @socket.puts(message)
end

#read_command(prompt) ⇒ Object



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

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