Sha256: 1faa7eb08ecae7299b0056e6f348699155b40184f6bc2df27a428a00c2ee356f

Contents?: true

Size: 322 Bytes

Versions: 1

Compression:

Stored size: 322 Bytes

Contents

module BlankSlate
  def BlankSlate(klass, &block)
    blank_slate = Class.new(klass, &block)
    blank_slate.class_eval do
      klass.instance_methods(false).
      reject{|meth| instance_methods(false).include?(meth) }.
      each do |meth|
        define_method(meth){ nil }
      end
    end
    blank_slate
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blank_slate-1.1.1 lib/blank_slate.rb