Class: Class

Inherits:
Object
  • Object
show all
Defined in:
lib/ludy/class/undef_all_methods.rb

Instance Method Summary collapse

Instance Method Details

#undef_all_methodsObject

undefine all instance methods, used for delegation class



4
5
6
7
8
# File 'lib/ludy/class/undef_all_methods.rb', line 4

def undef_all_methods
  instance_methods.each{ |m|
    undef_method m unless (m =~ /^__/ || m.to_sym == :object_id || m.to_sym == :public_send )
  }
end