Forum: Ruby Redefining #equal? for a really thin wrapper?

Accaf690f3d97aab6e6e02adac8150be?d=identicon&s=25 Student Jr (student)
on 2014-03-27 03:29
I'm looking into DCI (Data, Context Interaction --  I'm unhappy with the
implementation I'm seeing, so I'm looking at rolling my own.  I've
decided that I want to use wrapper objects--really, really thin wrapper
objects.  In particular, my plan is to redefine the equality operators,
like so:

Of course, these things don't inherit from Object or Kernel.  I don't
want to go into the debate about how to implement DCI here.  My question
is simply whether or not anything in the ruby core breaks if I redefine
#equal? and #__object_id__.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.