阅读背景:

迭代序列并一次更改一个对象的最佳方法(Ruby)

来源:互联网 

I'm new to ruby and feel that I still do a lot of things in C sharpish way :-). Suppose you have an array of objects (Question :has_many=>:answers). I want to iterate over all answers and if some answers meet a criteria, change answer attribute. Currently I'm doing it as follows:I'm new to ruby and feel that I still do a lot




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

分享到: