Avoid using instance_variable_get on objects of other class
This commit is contained in:
parent
5270b6ec06
commit
95911166f3
|
@ -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?
|
||||
|
||||
|
|
Loading…
Reference in New Issue