Class: FancyIrb::ErrorCapturer
- Inherits:
-
Object
- Object
- FancyIrb::ErrorCapturer
- Defined in:
- lib/fancy_irb/error_capturer.rb
Instance Method Summary collapse
- #error_string ⇒ Object
-
#initialize ⇒ ErrorCapturer
constructor
A new instance of ErrorCapturer.
- #restore_original_stdout ⇒ Object
Constructor Details
#initialize ⇒ ErrorCapturer
Returns a new instance of ErrorCapturer.
5 6 7 8 |
# File 'lib/fancy_irb/error_capturer.rb', line 5 def initialize @original_stdout, $stdout = $stdout, StringIO.new @fake_stdout = $stdout end |
Instance Method Details
#error_string ⇒ Object
10 11 12 |
# File 'lib/fancy_irb/error_capturer.rb', line 10 def error_string @fake_stdout.string end |
#restore_original_stdout ⇒ Object
14 15 16 |
# File 'lib/fancy_irb/error_capturer.rb', line 14 def restore_original_stdout $stdout = @original_stdout end |