Last active
October 17, 2022 22:33
-
-
Save JoshCheek/ee139e1db8dfa67c844551113ba97596 to your computer and use it in GitHub Desktop.
Stateful default hash values
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
🤘 = Hash.new(Lol = Class.new) | |
🤘[🤘].define_method(:bbq) { 🤘[🤘] } | |
class Omg < 🤘[:😈] | |
instance_eval { alias wtf new } | |
end | |
Omg.wtf.bbq # => Lol |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment