A
Alex Wayne
I am trying to define a method that you call like this:
@obj.foo[123]
I thought I knew how to do this. I tried to setup the method like so:
def foo[](value)
value * 2
end
But this gives me a syntax error right at that first brace. I could
have sworn this worked before. What am I doing wrong?
ruby 1.8.6
@obj.foo[123]
I thought I knew how to do this. I tried to setup the method like so:
def foo[](value)
value * 2
end
But this gives me a syntax error right at that first brace. I could
have sworn this worked before. What am I doing wrong?
ruby 1.8.6