Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Ruby allows parentheses to be omitted from most method invocations. In simple cases, this results in clean-looking code. In complex cases, however, it causes syntactic ambiguities and confusing corner cases. We’ll consider these in the sections that follow.
Parentheses are omitted from method invocations in many common Ruby idioms. The following two lines of code, for example, are equivalent: