Class: Pry::Shell::Client
- Inherits:
-
Object
- Object
- Pry::Shell::Client
- Includes:
- DRb::DRbUndumped
- Defined in:
- lib/pry/shell/client.rb
Constant Summary collapse
- MAX_PROCESS_NAME =
50
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #current? ⇒ Boolean
- #editor ⇒ Object
-
#initialize(id, process_name, host, pid, location) ⇒ Client
constructor
A new instance of Client.
- #input ⇒ Object
- #output ⇒ Object
- #pager_proxy ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(id, process_name, host, pid, location) ⇒ Client
Returns a new instance of Client.
16 17 18 19 20 21 22 23 |
# File 'lib/pry/shell/client.rb', line 16 def initialize(id, process_name, host, pid, location) @id = id @process_name = process_name @host = host @location = location @pid = pid @created_at = Time.now end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
14 15 16 |
# File 'lib/pry/shell/client.rb', line 14 def id @id end |
Instance Method Details
#current? ⇒ Boolean
45 46 47 |
# File 'lib/pry/shell/client.rb', line 45 def current? Shell.registry.current == self end |
#editor ⇒ Object
33 34 35 |
# File 'lib/pry/shell/client.rb', line 33 def editor @editor ||= proc { |file, line| IO::Editor.open(file, line) } end |
#input ⇒ Object
25 26 27 |
# File 'lib/pry/shell/client.rb', line 25 def input @input ||= IO::Input.new(self, Pry.config.input) end |
#output ⇒ Object
29 30 31 |
# File 'lib/pry/shell/client.rb', line 29 def output @output ||= IO::Output.new(self, Pry.config.output) end |
#pager_proxy ⇒ Object
37 38 39 |
# File 'lib/pry/shell/client.rb', line 37 def pager_proxy @pager_proxy ||= IO::Pager::Proxy.new(output) end |
#to_s ⇒ Object
41 42 43 |
# File 'lib/pry/shell/client.rb', line 41 def to_s "[#{pid}] \"#{humanized_process_name}\" @\"#{host}\" - #{full_location}" end |