Yield


#1

Hi.
So based on the descriptions that code academy has given I'm at a complete loss as to why I would ever need to use a yield. Anyone able to break it down into an actual real world context as to its use?


#2

I have forgotten much of Ruby but here's two links I got by searching:

https://rubymonk.com/learning/books/4-ruby-primer-ascent/chapters/18-blocks/lessons/54-yield
http://www.tutorialspoint.com/ruby/ruby_blocks.htm

Hope it helps!


#3

Thank you. I've been trawling google and stackoverflow for a while looking for something that makes sense to me.