M
Mark Volkmann
I assumed incorrectly that Array#delete deleted a specific object,
using eql? (identity). I later discovered that it uses =3D=3D (same
values). Then I looked for a method to delete using eql? and couldn't
find one. I ended up using the following. Is there a better way?
obj_to_delete =3D whatever
my_array.delete_if { |element| element.eql?(object_to_delete) }
using eql? (identity). I later discovered that it uses =3D=3D (same
values). Then I looked for a method to delete using eql? and couldn't
find one. I ended up using the following. Is there a better way?
obj_to_delete =3D whatever
my_array.delete_if { |element| element.eql?(object_to_delete) }