In Ruby, all operators have to be written at the end of the line to make it possible to distinguish between complete statements (with a missing semicolon) and continuations.
The only exception is the '.' operator, which is allowed to be on the next line to make method chaining look better, as follows:
array.map....select....reject....group....sort...
What do you think is special about the ternary operator?
In Ruby, all operators have to be written at the end of the line to make it possible to distinguish between complete statements (with a missing semicolon) and continuations.
The only exception is the '.' operator, which is allowed to be on the next line to make method chaining look better, as follows:
array.map....select....reject....group....sort...
What do you think is special about the ternary operator?
I think that this is what he meant. If he uses IRB, then the syntax error comes up like: