From: Lars Date: 2008-01-04T21:04:58+09:00 Subject: Re: With statement On Jan 4, 11:51 am, ole __ wrote: > I'm pretty sure ruby doesn't have a with statement. Is it possible to > emulate one? Yes: module Kernel def with(obj, &b) obj.instance_eval(&b) end end Usage: class Foo def dostuff puts "doing stuff in Foo" end end foo = Foo.new with foo do dostuff end Rgds, Lars