Ruby 中的塊和產量 - Blocks and yields in Ruby

問題:

I am trying to understand blocks and yield and how they work in Ruby.我試圖瞭解塊和yield以及它們在 Ruby 中的工作方式。

How is yield used? yield如何使用? Many of the Rails applications I've looked at use yield in a weird way.我看過的許多 Rails 應用程序都以一種奇怪的方式使用了yield

Can someone explain to me or show me where to go to understand them?有人可以向我解釋或告訴我去哪裏理解他們嗎?


解決方案:

參考一: https://stackoom.com/question/Crmx
參考二: Blocks and yields in Ruby
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章