Explain Iterator Syntax on Ruby on Rails

前端 未结 7 1070
慢半拍i
慢半拍i 2021-01-20 03:25

I started learning Ruby on Rails and found myself confounded by the syntax, so I had to read about somet of the Ruby syntax. I learned the syntax from http://www.cs.auckland

7条回答
  •  花落未央
    2021-01-20 04:03

     do ||
        
    end
    

    This creates a temporary anonymous function which accepts an item into a temporary variable, and then lets things operate on that item. The anonymous function is passed in to the original specified to operate on the items yielded by that function.

提交回复
热议问题