From: Douglas Livingstone Date: 2005-12-09T00:23:02+09:00 Subject: Re: A small query 2005/12/8, Robert Klemme : > > > Can a similar thing be accomplished in Ruby? > > obj.instance_eval do > meth1 > meth2(param) > meth3(param1, param2) > end > def with(obj, &block) obj.instance_eval(&block) end class Foo; def bar; puts 'rab'; end; end foo = Foo.new with foo do bar end Regards, Douglas