Module: RactorRailsShim::ConstReassign

Defined in:
lib/ractor_rails_shim/foundation/const_reassign.rb

Class Method Summary collapse

Class Method Details

.call(target_module, name, value) ⇒ Object

Set a constant on target_module with $VERBOSE suppressed. Returns the new value.



16
17
18
19
20
21
22
23
24
# File 'lib/ractor_rails_shim/foundation/const_reassign.rb', line 16

def self.call(target_module, name, value)
  verbose, $VERBOSE = $VERBOSE, nil
  begin
    target_module.const_set(name, value)
  ensure
    $VERBOSE = verbose
  end
  value
end