Sha256: f15cdf1b6a52c5b29432eaf35edcfcb57942eb4ba932b4f060dc04621d16cc55

Contents?: true

Size: 241 Bytes

Versions: 15

Compression:

Stored size: 241 Bytes

Contents

class Class
  # undefine all instance methods, used for delegation class
  def undef_all_methods
    instance_methods.each{ |m|
      undef_method m unless (m =~ /^__/ || m.to_sym == :object_id || m.to_sym == :public_send )
    }
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
godfat-ludy-0.1.13 lib/ludy/class/undef_all_methods.rb
ludy-0.1.15 lib/ludy/class/undef_all_methods.rb
ludy-0.1.0 lib/ludy/class/undef_all_methods.rb
ludy-0.1.1 lib/ludy/class/undef_all_methods.rb
ludy-0.1.10 lib/ludy/class/undef_all_methods.rb
ludy-0.1.11 lib/ludy/class/undef_all_methods.rb
ludy-0.1.13 lib/ludy/class/undef_all_methods.rb
ludy-0.1.2 lib/ludy/class/undef_all_methods.rb
ludy-0.1.9 lib/ludy/class/undef_all_methods.rb
ludy-0.1.3 lib/ludy/class/undef_all_methods.rb
ludy-0.1.4 lib/ludy/class/undef_all_methods.rb
ludy-0.1.5 lib/ludy/class/undef_all_methods.rb
ludy-0.1.6 lib/ludy/class/undef_all_methods.rb
ludy-0.1.7 lib/ludy/class/undef_all_methods.rb
ludy-0.1.8 lib/ludy/class/undef_all_methods.rb