Reputation: 491
In Ruby, Can I override the ternary operator '?'
Upvotes: 2
Views: 231
Reputation: 46677
No, you can't: ?: is not a method, so you can't redefine it.
?:
This operator precedence table shows which operators are really methods, and hence available to be overridden.
Upvotes: 6