Skip to content

Instantly share code, notes, and snippets.

@trevmex
Created October 2, 2010 14:19
Show Gist options
  • Select an option

  • Save trevmex/607672 to your computer and use it in GitHub Desktop.

Select an option

Save trevmex/607672 to your computer and use it in GitHub Desktop.
class CutItUp
def singleton_class
class <<self; self; end
end
def lol
puts "LOL"
end
def delete_method(method)
new_guy = self.dup
new_guy.singleton_class.send(:undef_method, method)
new_guy
end
end
c = CutItUp.new
c.delete_method(:lol)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment