Sha256: 007cc55babfb6e71feb3d3ac6a831f36e6a0990514b04a4597f41708f20342cf
Contents?: true
Size: 514 Bytes
Versions: 10
Compression:
Stored size: 514 Bytes
Contents
require 'facets/functor' module Kernel # Same as using NOT operator '!'. # # true.nil?.not? == !true.nil? # def not? !self end # Inversion functor. # # true.not.nil? #=> true # def not Functor.new(&method(:not_send).to_proc) end ## TODO: When we no longer need to support 1.8.6 we can use: ## ## def not ## Functor.new do |op, *a, &b| ## !__send__(op, *a, &b) ## end ## end private # def not_send(op, *a, &b) !__send__(op, *a) end end
Version data entries
10 entries across 9 versions & 2 rubygems