RubySource: Getting to Grips with Blocks

Tweet

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

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

No Reader comments