summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/RubyUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/RubyUtil.cpp')
-rw-r--r--cpp/src/Slice/RubyUtil.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index 3227446ee82..86869339cab 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -1021,6 +1021,17 @@ Slice::Ruby::CodeVisitor::visitStructStart(const StructPtr& p)
_out << nl << "end";
//
+ // eql?
+ //
+ // This method is used to determine the equality of keys in a Hash object.
+ //
+ _out << sp << nl << "def eql?(other)";
+ _out.inc();
+ _out << nl << "return other.class == self.class && other == self";
+ _out.dec();
+ _out << nl << "end";
+
+ //
// inspect
//
_out << sp << nl << "def inspect";