Sha256: 89377e2921719daef69b996f89e2d4948d71454a31042f93910238722b9c620f

Contents?: true

Size: 600 Bytes

Versions: 2

Compression:

Stored size: 600 Bytes

Contents

module Hardmock #:nodoc:
  module MethodCleanout #:nodoc:
    SACRED_METHODS = %w{
      __id__
      __send__
      equal?
      object_id
      send
      nil?
      class
      kind_of?
      respond_to?
      inspect
      method
      to_s
      instance_variables
      instance_eval
      ==
      hm_metaclass
      hm_meta_eval
      hm_meta_def
    }

    def self.included(base) #:nodoc:
      base.class_eval do
        instance_methods.each do |m| 
          undef_method m unless SACRED_METHODS.include?(m.to_s)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ceedling-0.29.1 vendor/hardmock/lib/hardmock/method_cleanout.rb
ceedling-0.29.0 vendor/hardmock/lib/hardmock/method_cleanout.rb