<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Comparing custom objects in Ruby using uniq.</title>
	<atom:link href="http://www.rabbitcreative.com/2008/01/23/comparing-custom-objects-in-ruby-using-uniq/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rabbitcreative.com/2008/01/23/comparing-custom-objects-in-ruby-using-uniq/</link>
	<description>ruby, rails, objects and &#60;del&#62;politics&#60;/del&#62; markets</description>
	<lastBuildDate>Wed, 16 Dec 2009 21:48:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jeremy</title>
		<link>http://www.rabbitcreative.com/2008/01/23/comparing-custom-objects-in-ruby-using-uniq/comment-page-1/#comment-2627</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Wed, 16 Dec 2009 21:48:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.rabbitcreative.com/2008/01/23/comparing-custom-objects-with-uniq/#comment-2627</guid>
		<description>DUDE! Nice. This clears up some stuff too.</description>
		<content:encoded><![CDATA[<p>DUDE! Nice. This clears up some stuff too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Matheson</title>
		<link>http://www.rabbitcreative.com/2008/01/23/comparing-custom-objects-in-ruby-using-uniq/comment-page-1/#comment-2623</link>
		<dc:creator>Tim Matheson</dc:creator>
		<pubDate>Sun, 08 Feb 2009 18:21:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.rabbitcreative.com/2008/01/23/comparing-custom-objects-with-uniq/#comment-2623</guid>
		<description>Very entertaining.</description>
		<content:encoded><![CDATA[<p>Very entertaining.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rabbit</title>
		<link>http://www.rabbitcreative.com/2008/01/23/comparing-custom-objects-in-ruby-using-uniq/comment-page-1/#comment-1405</link>
		<dc:creator>Rabbit</dc:creator>
		<pubDate>Fri, 25 Jan 2008 23:25:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.rabbitcreative.com/2008/01/23/comparing-custom-objects-with-uniq/#comment-1405</guid>
		<description>Interesting information on the #hash method. However, we&#039;re both right and both wrong. I should know better than to type code directly into WordPress... (My example code differs from the code I was using in console.)

The example code as I have it works if all you define is eql?. However, if you find existing clients, each with a unique ID, it doesn&#039;t.

It works with new objects because nil.hash is the same as nil.hash.

It doesn&#039;t work with found objects because 1.hash is not 2.hash.

We override the name attribute of Client because &quot;Rabbit&quot;.hash is the same as &quot;Rabbit&quot;.hash.

Thanks for pointing that out. =)

I&#039;ll edit the post to reflect the new information.</description>
		<content:encoded><![CDATA[<p>Interesting information on the #hash method. However, we&#8217;re both right and both wrong. I should know better than to type code directly into WordPress&#8230; (My example code differs from the code I was using in console.)</p>
<p>The example code as I have it works if all you define is eql?. However, if you find existing clients, each with a unique ID, it doesn&#8217;t.</p>
<p>It works with new objects because nil.hash is the same as nil.hash.</p>
<p>It doesn&#8217;t work with found objects because 1.hash is not 2.hash.</p>
<p>We override the name attribute of Client because &#8220;Rabbit&#8221;.hash is the same as &#8220;Rabbit&#8221;.hash.</p>
<p>Thanks for pointing that out. =)</p>
<p>I&#8217;ll edit the post to reflect the new information.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ Smith</title>
		<link>http://www.rabbitcreative.com/2008/01/23/comparing-custom-objects-in-ruby-using-uniq/comment-page-1/#comment-1394</link>
		<dc:creator>Russ Smith</dc:creator>
		<pubDate>Thu, 24 Jan 2008 23:38:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.rabbitcreative.com/2008/01/23/comparing-custom-objects-with-uniq/#comment-1394</guid>
		<description>You only have to override the eql? method. :D

The hash method is part of ActiveRecord and is defined as:

def hash
  id.hash
end

The hash method that is part of all objects creates a sort of checksum of the value passed.</description>
		<content:encoded><![CDATA[<p>You only have to override the eql? method. :D</p>
<p>The hash method is part of ActiveRecord and is defined as:</p>
<p>def hash<br />
  id.hash<br />
end</p>
<p>The hash method that is part of all objects creates a sort of checksum of the value passed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
