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.4.6.4 lib/sugar-high/not.rb
sugar-high-0.4.6.3 lib/sugar-high/not.rb
sugar-high-0.4.6.2 lib/sugar-high/not.rb
sugar-high-0.4.6.1 lib/sugar-high/not.rb
sugar-high-0.4.6 lib/sugar-high/not.rb
sugar-high-0.4.5.2 lib/sugar-high/not.rb
sugar-high-0.4.5 lib/sugar-high/not.rb
sugar-high-0.4.4.2 lib/sugar-high/not.rb
sugar-high-0.4.4.1 lib/sugar-high/not.rb
sugar-high-0.4.4 lib/sugar-high/not.rb
sugar-high-0.4.3 lib/sugar-high/not.rb
sugar-high-0.4.0 lib/sugar-high/not.rb
sugar-high-0.3.7 lib/sugar-high/not.rb
sugar-high-0.3.6 lib/sugar-high/not.rb
sugar-high-0.3.5 lib/sugar-high/not.rb
sugar-high-0.3.4 lib/sugar-high/not.rb
sugar-high-0.3.3 lib/sugar-high/not.rb
sugar-high-0.3.2 lib/sugar-high/not.rb
sugar-high-0.3.1 lib/sugar-high/not.rb
sugar-high-0.3.0 lib/sugar-high/not.rb