阅读背景:

向Ruby数组添加回调函数,以便在添加元素时执行某些操作

来源:互联网 

I'd like to add something like a callback function to a Ruby array, so that when elements are added to that array, this function is called. One thing I can think of is to override all methods (like <<, =, insert, ...) and call that callback from there.I'd like to add something like a callback funct




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: