Code Review
/
common
/
thrift.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
8eaebfe
)
THRFIT-231. rb: Make Thrift::Structs hashable
author
Kevin Clark
<kclark@apache.org>
Mon, 5 Jan 2009 23:00:22 +0000
(23:00 +0000)
committer
Kevin Clark
<kclark@apache.org>
Mon, 5 Jan 2009 23:00:22 +0000
(23:00 +0000)
Author: Bryan Duxbury
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731760
13f79535
-47bb-0310-9956-
ffa450edef68
lib/rb/lib/thrift/struct.rb
patch
|
blob
|
history
diff --git
a/lib/rb/lib/thrift/struct.rb
b/lib/rb/lib/thrift/struct.rb
index
4b99168
..
25eb981
100644
(file)
--- a/
lib/rb/lib/thrift/struct.rb
+++ b/
lib/rb/lib/thrift/struct.rb
@@
-129,6
+129,15
@@
module Thrift
true
end
+ def eql?(other)
+ self.class == other.class && self == other
+ end
+
+ # for the time being, we're ok with a naive hash. this could definitely be improved upon.
+ def hash
+ 0
+ end
+
def self.field_accessor(klass, *fields)
fields.each do |field|
klass.send :attr_reader, field