reverocean 发表于 2013-1-29 23:45:43

Iterators in Ruby

Up to now,I know four iterator methods.They are each,find,collect and inject.

The each method access every element in collections and pass each element to the block which is defined by two braces or do/end.Then you can use the element in block and deal with them by any way.
<div class="code_title">ruby Code
页: [1]
查看完整版本: Iterators in Ruby