FaqRubyMethods

Should I use parentheses or spaces around Ruby method arguments?

Some Ruby developers prefer parentheses around their method arguments; others prefer spaces. NetBeans currently tries to guess which style to use based on the documentation associated with the method. Thus, it will use parentheses if you complete File.exists() in Ruby's core library, but it will use spaces around Rails controllers' render method.

If you run with the following flag (or add to your etc/netbeans.conf file), it will always prefer spaces:

-J-Druby.complete.spaces=true

There is one exception to this. The IDE will check to see if it looks like the call will be ambiguous (which is the case for nested calls) and if so, it will use parentheses anyway.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo