Class: ConvenientService::Utils::Kernel::SilenceWarnings
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Kernel::SilenceWarnings
- Defined in:
- lib/convenient_service/utils/kernel/silence_warnings.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
-
#call ⇒ Hash
NOTE: When
$VERBOSE
is set tofalse
, Ruby still emits warnings (at least in RSpec). - #initialize(&block) ⇒ void constructor
Methods inherited from Support::Command
Constructor Details
#initialize(&block) ⇒ void
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)
Returns the value of attribute block.
20 21 22 |
# File 'lib/convenient_service/utils/kernel/silence_warnings.rb', line 20 def block @block end |
Instance Method Details
#call ⇒ Hash
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 |