Skip to content

Instantly share code, notes, and snippets.

@jlindley
Created December 17, 2009 01:11
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 jlindley/258407 to your computer and use it in GitHub Desktop.
Save jlindley/258407 to your computer and use it in GitHub Desktop.
module Kernel
def other
o = []
ObjectSpace.each_object{|obj| o << obj unless (o==self)}
o
end
end
class Teapot
def me
puts "I am this teapot: #{self}"
end
def not_me
puts "I am not: #{other.join(',')}"
end
end
teapot = Teapot.new
teapot.me
teapot.not_me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment