From: Robert Dober Date: 2009-05-07T17:01:03+09:00 Subject: Re: Adding a =~ method to the Method class On Thu, May 7, 2009 at 9:02 AM, Gabriel Saravia wrote: > What about class UnboundMethod def similar? other case other when self.class self == other when BoundMethod self == other.unbind else false # or if you prefer raise WhateverSeemsFit, "blah" end end end class BoundMethod def similar? other case other when self.class unbind == other.unbind etc.etc. Cheers Robert -- Si tu veux construire un bateau ... Ne rassemble pas des hommes pour aller chercher du bois, préparer des outils, répartir les tâches, alléger le travail… mais enseigne aux gens la nostalgie de l’infini de la mer. If you want to build a ship, don’t herd people together to collect wood and don’t assign them tasks and work, but rather teach them to long for the endless immensity of the sea. -- Antoine de Saint-Exupéry