So I discovered that MyClass.new(1) !== MyClass.new(1)
as Reference
is the default parent of classes.
Which is indeed a sensible default.
But
def ==(other : self)
prop1 == other.prop1 && prop2 == other.prop2 && prop3 == other.prop3
end
doesn’t feel very elegant, and get pretty annoying with a lot of instance variables (as one might end up with when deserializing JSON from some API).
Is there a more elegant way to do it?