Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
class hierarchy with rdoc
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="matt neuburg, post: 4555786"] Also I find it useful to have on hand a little utility for generating a report about a class's ancestry, such as this: def method_report(klass) result = klass.ancestors.inject(Array.new) do |result, anc| ms = (anc.instance_methods + anc.methods).sort.uniq result.last[1] -= ms if result.last result << [anc.name, ms] end result.each do |k, v| puts "----", k v.each {|m| puts "\s\s#{m}"} end end # and here's how to use it method_report(File) That's basically what you were already doing in irb, but going a little further. :) HTH - m. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
class hierarchy with rdoc
Top