Ruby Blocks and Template Method Pattern

I was reading the Programming Ruby book yesterday and the explanation
for Ruby blocks sounded very similar to Template Method pattern that I
used in other object-oriented languages.

Is my understanding correct? TIA

On 2/5/07, [email protected] [email protected] wrote:

I was reading the Programming Ruby book yesterday and the explanation
for Ruby blocks sounded very similar to Template Method pattern that I
used in other object-oriented languages.

Is my understanding correct? TIA

Yes, that’s one way of looking at it. Using blocks can be like
“filling in the blank” in a template method.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs