L
Leon Bogaert
Hi all,
A quick question: is it possible to monkey patch the Array [] method in
ruby?
I tried:
class Array
def []=(elem)
raise 'Yesss... It works!'
end
end
But that didn't work. I tried patching the Kernel module but that didn't
have any effect either. Is the [] hidden else somewhere? Or do I have to
use rubinius for that?
Thanks!
Leon
A quick question: is it possible to monkey patch the Array [] method in
ruby?
I tried:
class Array
def []=(elem)
raise 'Yesss... It works!'
end
end
But that didn't work. I tried patching the Kernel module but that didn't
have any effect either. Is the [] hidden else somewhere? Or do I have to
use rubinius for that?
Thanks!
Leon