Ruby Blocks and Template Method Pattern

B

bcparanj

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
 
A

Avdi Grimm

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,232
Messages
2,571,168
Members
47,803
Latest member
ShaunaSode

Latest Threads

Top