In which class/module is the = method in Ruby? -
Do anyone know how the class / module = method is in Ruby?
I want to convert
a = b
in
equal to b In
I should know which class / module is such, so I can surname.
Thank you.
=
is the assignment operator I can not be redefined.
In addition, you can not define new operators. As Yeharg tells, is equal to B
is similar to a (equal to b)
or equivalently self.a (self.equals (b))
, therefore, you need an object that responds to both : a
message and : equal
message.
Comments
Post a Comment