Class: Object

Inherits:
BasicObject
Defined in:
lib/light_enum.rb

Instance Method Summary collapse

Instance Method Details

#silence_warningsObject



47
48
49
# File 'lib/light_enum.rb', line 47

def silence_warnings
  with_warnings(nil) { yield }
end

#with_warnings(flag) ⇒ Object



51
52
53
54
55
56
# File 'lib/light_enum.rb', line 51

def with_warnings(flag)
  old_verbose, $VERBOSE = $VERBOSE, flag
  yield
ensure
  $VERBOSE = old_verbose
end