Class: ConvenientService::Utils::Kernel::SilenceWarnings Private
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Kernel::SilenceWarnings
- Defined in:
- lib/convenient_service/utils/kernel/silence_warnings.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #block ⇒ Object readonly private
Instance Method Summary collapse
-
#call ⇒ Hash
private
NOTE: When
$VERBOSEis set tofalse, Ruby still emits warnings (at least in RSpec). - #initialize(&block) ⇒ void constructor private
Methods inherited from Support::Command
Constructor Details
#initialize(&block) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/convenient_service/utils/kernel/silence_warnings.rb', line 26 def initialize(&block) @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'lib/convenient_service/utils/kernel/silence_warnings.rb', line 20 def block @block end |
Instance Method Details
#call ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
NOTE: When $VERBOSE is set to false, Ruby still emits warnings (at least in RSpec).
41 42 43 44 45 46 47 |
# File 'lib/convenient_service/utils/kernel/silence_warnings.rb', line 41 def call old_verbose, $VERBOSE = $VERBOSE, nil block.call ensure $VERBOSE = old_verbose end |