On 11.06.2007 03:25, Nicko wrote:
> On Jun 10, 8:46 pm, Robert Klemme <shortcut... / googlemail.com> wrote:
>> It is usually not such a good idea to inherit base classes like Array
>> and Hash.  Here are two more healthy approaches.
> 
> The code is meant to be getting two lists of files, one on a usb stick
> and one on a network share, putting them in hashes (for filename, size
> and md5 hash) and now i want a list of the files that are in one list
> but not on the other.

Why then don't you just substract key arrays (assuming that your keys 
are file names)?  Or is size and MD5 important for your comparison?  In 
that case I'd probably do this:

FileInfo = Struct.new :file_name, :size, :md5

If you put instances of this class in an Array or Set your substraction 
logic will work.

> If the hashes are the same, they won't be the same instance because
> they were generated seperately.
> 
> Why is inheriting from Array not a healthy approach?

See my other reply.

Kind regards

	robert