Skip to content
Poignant Guide Ruby Q&A
Sections

blocks

1 thread tagged with this topic

Threads tagged blocks

  1. ✓

    What is a block in Ruby, and what does yield do?

    A block is a chunk of code you hand to a method, written between do and end or between braces. Inside the method, the word yield runs that chunk, once for each...

    Blocks, procs and iteratorsOdile MarchettiStaff answer
    0replies
Poignant Guide Ruby Q&A. Questions and answers on learning Ruby and programming: syntax, blocks, objects, gems, Rails, debugging and reading the Poignant Guide.