Class: Opal::REPL::Silencer
- Inherits:
- 
      Object
      
        - Object
- Opal::REPL::Silencer
 
- Defined in:
- opal/lib/opal/repl.rb
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.
| 135 136 137 | # File 'opal/lib/opal/repl.rb', line 135 def initialize @stderr = $stderr end | 
Instance Method Details
#silence ⇒ Object
| 139 140 141 142 143 144 145 | # File 'opal/lib/opal/repl.rb', line 139 def silence @collector = StringIO.new $stderr = @collector yield ensure $stderr = @stderr end | 
#warnings ⇒ Object
| 147 148 149 | # File 'opal/lib/opal/repl.rb', line 147 def warnings @collector.string end |