I want to create a filter, and be able to apply it to an array or hash. For example:
def isodd(i)
i % 2 == 1
end
The I want to be able to use it like so:
x = [1,2,3,4]
puts x.select(isodd)
x.delete_if(isodd)
puts x
This seems like it should be straight forward, but I can't figure out what I need to do it get it to work.