From: Phillip Gawlowski Date: 2010-01-01T15:33:00+09:00 Subject: Re: send emails On 01.01.2010 07:26, Ruby Newbee wrote: > Thanks Phillip. > Can you kindly tell me how to write that a method? Not me directly, no, but I found this: http://blog.codahale.com/2005/11/24/a-ruby-howto-writing-a-method-that-uses-code-blocks/ > I know something like: > > class Myclass > def myfunc a,b,c > do_something_with a,b,c > end > end > > x= Myclass.new > x.myfunc(1,2,3) > > but I dont know how to write a method which accepts a block (like the > above smtp one). > THanks. It's not much different than that. def block yield end is a simple block method already. Not terribly useful, but it's the foundation to build from. :) -- Phillip Gawlowski