From: Stefano Crocco Date: 2008-10-16T20:24:08+09:00 Subject: Re: A Ruby block question Alle Thursday 16 October 2008, David Trasbo ha scritto: > I am in need of making a method that accepts a block. It basicly needs > to do the following: > > * The method it self should output some content first. > * Then after that content it should output the content defined in > &block. > * And at last output some other content defined by the method it self. > > In other words I need to put user-defined input in between some > pre-defined content. How can I approach that? If I understand correctly what you want to do, you don't need to do anything special: def my_method puts "predefined text 1" puts yield puts "predefined text 2" end Stefano