CommonThread

Tip: TextMate New Ruby Method

Posted by anthony crumley, Tue Dec 11 09:33:00 UTC 2007

There are two ways to quickly create a Ruby method in TextMate. The first is to type def and then press the tab key. The result will be…

def method_name

end

The method_name will be highlighted and ready for you to type the name of your method with any necessary parameters. Once the name and parameters are entered you can press tab to begin writing the method.

The second way is to type the name of the method followed by shift-return. If the method name is find then the result will be…

def find(args)

end

The args will be highlighted and ready for you to enter the parameters. If the method does not require parameters then simply press delete once to remove args and the parenthesis. When you have deleted or entered the parameters press tab to begin writing the method.

Filed Under: | Tags:

Comments

Have your say

A name is required. You may use HTML in your comments.




Categories