I have defined a method that I want to apply to a list:
class Foobar
def foo(x)
x+1
end
def bar(list)
list.map {|x| foo x}
end
end
I was expecting to be able to do something like list.map(foo) as it seems rather redundant to create a lambda function that just applies its arguments to a function.