Skip to content

Instantly share code, notes, and snippets.

@valachi
Created March 3, 2013 16:20
Show Gist options
  • Select an option

  • Save valachi/5076730 to your computer and use it in GitHub Desktop.

Select an option

Save valachi/5076730 to your computer and use it in GitHub Desktop.
class Object
def definee
eval 'def __; end'
definee = method(:__).owner rescue instance_method(:__).owner
eval 'undef __'
definee
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment