Avoid using instance_variable_get on objects of other class

This commit is contained in:
Wojciech Piekutowski 2011-02-20 17:01:57 +01:00
parent 5270b6ec06
commit 95911166f3
1 changed files with 2 additions and 2 deletions

View File

@ -84,9 +84,9 @@ module BSON
# Check equality of this object id with another.
#
# @param [Mongo::ObjectId] object_id
# @param [BSON::ObjectId] object_id
def eql?(object_id)
@data == object_id.instance_variable_get("@data")
object_id.kind_of?(BSON::ObjectId) and self.data == object_id.data
end
alias_method :==, :eql?