Sha256: feaac6b7a13c4533f329ee7b98e5f95a86ac9d551bca7953f79f876a48612803

Contents?: true

Size: 468 Bytes

Versions: 7

Compression:

Stored size: 468 Bytes

Contents

module Bogus
  class ClassMethods
    extend Takes
    takes :klass

    def all
      klass.methods - Class.methods - bogus_methods
    end

    def get(name)
      klass.method(name)
    end

    def remove(name)
      klass.instance_eval "undef #{name}"
    end

    def define(body)
      klass.instance_eval(body)
    end

    private

    def bogus_methods
      [:__shadow__, :__reset__, :__overwrite__, :__overwritten_methods__, :__record__]
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bogus-0.1.7 lib/bogus/fakes/class_methods.rb
bogus-0.1.6 lib/bogus/fakes/class_methods.rb
bogus-0.1.5 lib/bogus/fakes/class_methods.rb
bogus-0.1.4 lib/bogus/fakes/class_methods.rb
bogus-0.1.3 lib/bogus/class_methods.rb
bogus-0.1.2 lib/bogus/class_methods.rb
bogus-0.1.1 lib/bogus/class_methods.rb