From: Greg Millam Date: 2005-10-17T13:23:49+09:00 Subject: Re: Editing in Ruby Shreyas wrote: > In any case, I was wondering if anyone knew either (a) how to get a > list of all the functions in ruby exported to an API file, or (b) if > there is an editor out there that can help out. Many times when I'm > programming, it's nice to just be able to see what the valid > functions are for the object in question, rather than having to look > it up in the API documentation. Use irb with irb/completion $ irb irb(main):001:0> require 'irb/completion' => true irb(main):002:0> f = "Hello, world!" => "Hello, world!" irb(main):003:0> f.downcase f.downcase f.downcase! irb(main):003:0> f.downcase If you hit f.down, it'll complete to downcase. hit it twice, and it'll show "f.downcase f.downcase!" If you want to find other methods, try using f.methods.grep irb(main):004:0> f.methods.grep /case/ => ["downcase", "downcase!", "casecmp", "swapcase", "swapcase!", "upcase", "upcase!"] f.case will pull out f.casecmp for you. This works with any valid object in irb. irb(main):005:0> i = 1 => 1 irb(main):006:0> i.methods.grep /case/ => [] irb(main):007:0> i.methods.grep /zero/ => ["zero?", "nonzero?"] It's very handy, and I use it a lot, even though I've been rubying for about 3 years. Hope that helps you, too! - Greg