On Thu, Oct 16, 2008 at 08:20:34PM +0900, David Trasbo wrote:
> 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?

Look at yield? 


def foo(&block)
  puts "Oh Hai"
  yield
  puts "kthxbai"
end

fooi {puts "No Wai!"}

-- 
nathan
nathan_at_nathanpowell_dot_org

Another flaw in the human character is that everybody wants to build
and nobody wants to do maintenance.
		 ~ Kurt Vonnegut
------------------------------------