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.7.3 lib/sugar-high/not.rb
sugar-high-0.7.2 lib/sugar-high/not.rb
sugar-high-0.7.1 lib/sugar-high/not.rb
sugar-high-0.7.0 lib/sugar-high/not.rb
sugar-high-0.6.3 lib/sugar-high/not.rb
sugar-high-0.6.2.1 lib/sugar-high/not.rb
sugar-high-0.6.1 lib/sugar-high/not.rb
sugar-high-0.6.0 lib/sugar-high/not.rb
sugar-high-0.5.5 lib/sugar-high/not.rb
sugar-high-0.5.4 lib/sugar-high/not.rb
sugar-high-0.5.3 lib/sugar-high/not.rb
sugar-high-0.5.1 lib/sugar-high/not.rb
sugar-high-0.5.0 lib/sugar-high/not.rb
sugar-high-0.4.9.5 lib/sugar-high/not.rb
sugar-high-0.4.9.3 lib/sugar-high/not.rb
sugar-high-0.4.9.2 lib/sugar-high/not.rb
sugar-high-0.4.9.1 lib/sugar-high/not.rb
sugar-high-0.4.9 lib/sugar-high/not.rb
sugar-high-0.4.8 lib/sugar-high/not.rb
sugar-high-0.4.7 lib/sugar-high/not.rb