Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created January 9, 2020 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save havenwood/10bd7b107b3456ad41ef84620b69016b to your computer and use it in GitHub Desktop.
Save havenwood/10bd7b107b3456ad41ef84620b69016b to your computer and use it in GitHub Desktop.
Not advocating doing this—just think it's interesting
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