Class: Opal::IRB::Silencer
Instance Method Summary collapse
-
#initialize ⇒ Silencer
constructor
A new instance of Silencer.
- #silence ⇒ Object
- #warnings ⇒ Object
Constructor Details
#initialize ⇒ Silencer
Returns a new instance of Silencer.
90 91 92 |
# File 'opal/opal/corelib/irb.rb', line 90 def initialize @stderr = $stderr end |
Instance Method Details
#silence ⇒ Object
94 95 96 97 98 99 100 |
# File 'opal/opal/corelib/irb.rb', line 94 def silence @collector = ::StringIO.new $stderr = @collector yield ensure $stderr = @stderr end |
#warnings ⇒ Object
102 103 104 |
# File 'opal/opal/corelib/irb.rb', line 102 def warnings @collector.string end |