method
eql?
v2_4_6 -
Show latest stable
- Class:
Array
eql?(p1)public
Returns true if self and other are the same object, or are both arrays with the same content (according to Object#eql?).
1Note
Elements need to be in same order
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