S
stephan.zimmer
Hi all,
here is a novice's question: I am wondering how to equip a class with
a unary operator. Defining a method "-" like this
class Something
# ...
def -
# some code
end
# ...
end
I have to call "-" by writing
somethingelse = something.-
Is there a possibility to write this in prefix notation?
somethingelse = -something
Thanks in advance, best,
Stephan
here is a novice's question: I am wondering how to equip a class with
a unary operator. Defining a method "-" like this
class Something
# ...
def -
# some code
end
# ...
end
I have to call "-" by writing
somethingelse = something.-
Is there a possibility to write this in prefix notation?
somethingelse = -something
Thanks in advance, best,
Stephan