Tuesday February 20, 2007 If you try code completion on any complicated arbitrary expression, it will show you a number of possible method completions along with the corresponding class. This gives you much the same information as ri:
However, in many contexts, we know the exact type. For example, if you type File. and invoke code completion, NetBeans will show you only the singleton methods of class File (as well as inherited methods and module mixins):
In some cases, we know more than just the class - we know that we're dealing with an instance of that object. In that case we can show all the instance methods too - not just the class methods:
Here's we're applying code completion on a regular expression literal.
This works for all kinds of literals in your code - Strings, regular expressions (shown above), arrays (try [1,2,3].e to see the each method and its documentation for example), hashes, symbols, numbers, ... you can even try it on the "nil" keyword!
Posted by Romain Guy on February 20, 2007 at 05:52 PM PST #
Posted by HC on February 21, 2007 at 06:57 AM PST #
Posted by james hoskins on February 23, 2007 at 02:52 AM PST #
Posted by Tor Norbye on February 23, 2007 at 06:47 AM PST #
Posted by Jason on February 23, 2007 at 09:15 PM PST #
Posted by ditoinfo in english on February 25, 2007 at 08:59 PM PST #
Posted by dante regis on February 25, 2007 at 09:03 PM PST #
Posted by Tor Norbye on February 25, 2007 at 09:33 PM PST #
Posted by dcaoyuan on February 26, 2007 at 06:11 AM PST #
Posted by Tor Norbye on February 26, 2007 at 09:21 PM PST #