I've found the -@ operator redefinition in Rails/ActiveSupport:
https://github.com/rails/rails/blob/master/activesupport/lib/active_support/duration.rb#L33
Can you tell me what does it mean?
-@
and +@
are simply the method names for unary -
and +
. If you want to redefine them, invoke them as methods, etc., that's how you need to refer to them to distinguish them from binary -
and +
.
I think it defines what happens when the object is negated, for example:
x = -y
The y object needs to have a -@ operator defined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With