From: Jonas Hoffmann Date: 2003-01-06T19:10:30+09:00 Subject: Re: How many single Methods provides Ruby ? the end was wrong because u started the block with { i changed this but i receive 3 different error with my three differnt Rubyversins :D mt = 0; cm = 0; im = 0; Module.constants.each { |c| cnst = eval "#{c}" if cnst.respond_to?(:public_class_methods) cnst.public_class_methods.each { |m| puts m; cm +=1; mt +=1 } end if cnst.respond_to?(:public_instance_methods) cnst.public_class_methods.each { |m| puts m; im +=1; mt +=1 } end } puts puts "Total Public Class Methods: #{cm}" puts "Total Public Instance Methods: #{im}" puts "Total Public Methods: #{mt}" With ruby 1.6.7 i receive a methods.rb:8: undefined method `public_class_methods' for NotImplementedError:Class (NameError) from methods.rb:2:in `each' from methods.rb:2 with 1.6.8 i receive methods.rb:8: undefined method `public_class_methods' for MatchData:Class (NameError) from methods.rb:2:in `each' from methods.rb:2 and with 1.8.0 methods.rb:8: undefined method `public_class_methods' for Precision:Module (NoMethodError) from methods.rb:2:in `each' from methods.rb:2 :( mfg. Jonas