From: Robert Klemme Date: 2011-03-29T00:13:17+09:00 Subject: Re: with block in ruby On Mon, Mar 28, 2011 at 5:05 PM, Mario Ruiz wrote: > is there any way in ruby to do something like: > > with thisobject do >  .... > > > end Depends on what you want to do, probably use #instance_eval e.g irb(main):001:0> "foo".instance_eval do p size end 3 => 3 Or you can use #tap (1.9) irb(main):002:0> "foo".tap do |x| p x.size end 3 => "foo" Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/