From: ThoML Date: 2008-02-15T03:35:02+09:00 Subject: Re: lambda/procs and dynamically generated methods This can be done in almost endless different ways of course. Here are two other options: class Job def initialize(file=nil, &block) raise "need file or block" unless file or block @file = file @block = block end def do if @file File.read @file else @block.call end end end class Job def initialize(file=nil, &block) raise "need file or block" unless file or block @task = block || lambda { File.read file } end def do @task.call end end The second one is a slightly cleaned up version of your first proposal. Regards, Thomas.