Created
May 15, 2016 21:11
-
-
Save seki/b68ceecb2d50d85f783942d67324d91a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module OnGC | |
module_function | |
def on_gc(&blk) | |
ObjectSpace.define_finalizer(Object.new, &blk) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment