Skip to content

Instantly share code, notes, and snippets.

@jaredatron
Created April 24, 2009 18:30
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 jaredatron/101266 to your computer and use it in GitHub Desktop.
Save jaredatron/101266 to your computer and use it in GitHub Desktop.
class Object
define_method :not do
Not.new(self)
end
class Not
private *instance_methods.select { |m| m !~ /(^__|^\W|^binding$)/ }
def initialize(subject)
@subject = subject
end
def method_missing(sym, *args, &blk)
!@subject.send(sym,*args,&blk)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment