method

eql?

v1_8_7_72 - Show latest stable - Class: Array
eql?(p1)
public

Returns true if array and other are the same object, or are both arrays with the same content.

1Note

Elements need to be in same order

hescano ยท Nov 17, 2014

Note that even if the arrays have the same content, the elements need to be ordered:

==== Example:

x = [1, 2, 3]
y = [3, 2, 1]
z = [1, 2, 3]

x.eql?(y) #=> false
x.eql?(z) #=> true
x.eql?(y.sort) #=> true