
Blocks are sort of tricky when you first come to Ruby; I decided to make a quick little illustrated guide to using them.
accepts a block, denoted by the ampersand before the parameter . passes the newly created car object to the block. The block then sets the color of that car object. Finally sets to that newly colored car.
This is obviously a hugely simplified example, but hopefully it’ll help someone understand blocks a little better.