Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'binding_of_caller'
- class Module
- alias_method :omf, :module_function
- def module_function
- Binding.of_caller do |binding|
- eval "omf", binding
- end
- end
- end
- module X
- module_function
- def g
- end
- end
- X.g
- # undefined method `g' for X:Module (NoMethodError)
Add Comment
Please, Sign In to add comment