RubySource: Getting to Grips with Blocks

By Dave Kennedy

When making the switch to Ruby from a PHP background, one of the grayest areas for me was blocks. Blocks are everywhere in Ruby and not having a good understanding of them will stall your learning past the “novice” stage. When you first start out with Ruby you will inevitably use blocks exclusively for iteration. Hello Blocks 3.times n times” } The code above must be the “hello world” of blocks, and from that single line we get alot of what Ruby is all about

Continue Reading:
RubySource: Getting to Grips with Blocks


No Reader comments



Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

Instant Website Review

Use Woorank to analyze and optimize your website to improve your website to improve your ranking!

Run a review to see how your site can improve across 70+ metrics!

Get the latest in Entrepreneur, once a week, for free.