I have asked a similar question earlier: reference to a method?
but now I am trying to figure out how to do this with this code:
arr0 = [1,2,3]
arr1 = [2,3,4,5]
arr1.reject! {|x|
arr0.include? x
}
apparently {|x| arr0.include? x}
can be simplified to just arr0.include?
. But I do not know how to get this method reference.
EDIT: I am not interested in how to subtract arrays in Ruby using a simpler syntax. I am looking for a way to get a reference to a method.