Forum: Ruby Ruby Blocks and Template Method Pattern

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E3640176765dae2465d33ef6eb114691?d=identicon&s=25 bcparanj@gmail.com (Guest)
on 2007-02-05 20:36
(Received via mailing list)
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
4dea430d31b993abaf41cd9b54f8128d?d=identicon&s=25 Avdi Grimm (Guest)
on 2007-02-05 20:42
(Received via mailing list)
On 2/5/07, bcparanj@gmail.com <bcparanj@gmail.com> 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 topic is locked and can not be replied to.