Created
January 9, 2020 02:06
-
-
Save havenwood/10bd7b107b3456ad41ef84620b69016b to your computer and use it in GitHub Desktop.
Not advocating doing this—just think it's interesting
This file contains hidden or 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 RedInspect | |
| REFINED = [NilClass, Array, Array.singleton_class].freeze | |
| def inspect | |
| "\e[91m#{super}\e[0m" | |
| end | |
| self.then do |oneself| | |
| REFINED.each { refine(_1) { include oneself } } | |
| end | |
| end | |
| self.using RedInspect | |
| ## | |
| # And it's all red... | |
| puts nil.inspect | |
| puts [].inspect | |
| puts Array.inspect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment