Sha256: dfc5ccb9fbdb74421f0fa1fde46386ce7e56e1e9201a3eb5c30625332c852043

Contents?: true

Size: 306 Bytes

Versions: 55

Compression:

Stored size: 306 Bytes

Contents

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

55 entries across 55 versions & 1 rubygems

Version Path
sugar-high-0.2.12 lib/sugar-high/not.rb
sugar-high-0.2.11 lib/sugar-high/not.rb
sugar-high-0.2.10 lib/sugar-high/not.rb
sugar-high-0.2.9 lib/sugar-high/not.rb
sugar-high-0.2.8 lib/sugar-high/not.rb
sugar-high-0.2.7 lib/sugar-high/not.rb
sugar-high-0.2.6 lib/sugar-high/not.rb
sugar-high-0.2.5 lib/sugar-high/not.rb
sugar-high-0.2.4 lib/sugar-high/not.rb
sugar-high-0.2.2 lib/sugar-high/not.rb
sugar-high-0.2.1 lib/sugar-high/not.rb
sugar-high-0.2.0 lib/sugar-high/not.rb
sugar-high-0.1.8 lib/sugar-high/not.rb
sugar-high-0.1.7 lib/sugar-high/not.rb
sugar-high-0.1.6 lib/sugar-high/not.rb