Class: PryBot::SharedIO
Instance Attribute Summary collapse
-
#input_proxy ⇒ Object
Returns the value of attribute input_proxy.
-
#output_proxy ⇒ Object
Returns the value of attribute output_proxy.
Instance Method Summary collapse
-
#initialize ⇒ SharedIO
constructor
A new instance of SharedIO.
- #pry_eval(string) ⇒ Object
Constructor Details
#initialize ⇒ SharedIO
5 6 7 8 9 10 11 |
# File 'lib/shared-io.rb', line 5 def initialize @input = StringIO.new @output = StringIO.new @input_proxy = PryBot::StringIOProxy.new(@input) @output_proxy = PryBot::StringIOProxy.new(@output) end |
Instance Attribute Details
#input_proxy ⇒ Object
Returns the value of attribute input_proxy.
3 4 5 |
# File 'lib/shared-io.rb', line 3 def input_proxy @input_proxy end |
#output_proxy ⇒ Object
Returns the value of attribute output_proxy.
3 4 5 |
# File 'lib/shared-io.rb', line 3 def output_proxy @output_proxy end |
Instance Method Details
#pry_eval(string) ⇒ Object
13 14 15 16 17 |
# File 'lib/shared-io.rb', line 13 def pry_eval(string) @input_proxy << string sleep 0.1 @output_proxy.readlines end |