[Archipelago-submits] [164] trunk/archipelago/lib/archipelago/disco.rb: improved the efficiency and elegance of disco.rb greatly by realizing that ServiceDescription has to be seen as its content by hashes
nobody at rubyforge.org
nobody at rubyforge.org
Tue Jan 9 06:53:31 EST 2007
Revision: 164
Author: zond
Date: 2007-01-09 06:53:30 -0500 (Tue, 09 Jan 2007)
Log Message:
-----------
improved the efficiency and elegance of disco.rb greatly by realizing that ServiceDescription has to be seen as its content by hashes
Modified Paths:
--------------
trunk/archipelago/lib/archipelago/disco.rb
Modified: trunk/archipelago/lib/archipelago/disco.rb
===================================================================
--- trunk/archipelago/lib/archipelago/disco.rb 2006-12-28 15:38:55 UTC (rev 163)
+++ trunk/archipelago/lib/archipelago/disco.rb 2007-01-09 11:53:30 UTC (rev 164)
@@ -216,6 +216,18 @@
end
end
#
+ # Returns the hash of our @attributes.
+ #
+ def hash
+ @attributes.hash
+ end
+ #
+ # Returns whether our @attributes are equal to that of +o+.
+ #
+ def eql?(o)
+ ServiceDescription === o && @attributes == o.attributes
+ end
+ #
# Returns whether this ServiceDescription matches the given +match+.
#
def matches?(match)
More information about the Archipelago-submits
mailing list