Module: Mutant::RequireHighjack Private
- Defined in:
- lib/mutant/require_highjack.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Require highjack
Class Method Summary collapse
-
.call(target, callback) ⇒ #call
private
Install require callback.
Class Method Details
.call(target, callback) ⇒ #call
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.
Install require callback
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mutant/require_highjack.rb', line 14 def self.call(target, callback) target.public_method(:require).tap do target.module_eval do undef_method(:require) define_method(:require, &callback) class << self undef_method(:require) end define_singleton_method(:require, &callback) end end end |