Sha256: d708e321f9a84c5e014ca5b2f5b74c059ef8ee5581d180beaff3742c2398b009
Contents?: true
Size: 382 Bytes
Versions: 23
Compression:
Stored size: 382 Bytes
Contents
# http://blog.jayfields.com/2007/08/ruby-adding-not-method-for-readability.html 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
Version data entries
23 entries across 23 versions & 7 rubygems