开发者

One-liner to Count the Number of Methods I've defined in a Ruby Class?

What's the simplest way I can list the methods defined at each level in the tree?

Admin < User < ActiveRecord::Base开发者_如何学JAVA < ...

...and be able to take those methods and say which we defined in which module.


Admin.ancestors.each{|a| puts "For #{a} #{a.instance_methods(false)}"}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜