From: CHubas Date: 2007-05-27T02:05:23+09:00 Subject: Re: Introducing the "it" keyword > irb(main):001:0> def it_test(v) > irb(main):002:1> (v+1).instance_eval do > irb(main):003:2* return self if self < 10 > irb(main):004:2> end > irb(main):005:1> "nothing" > irb(main):006:1> end You can extend it and let the method do the work for you def do_if(var, cond) yield var if cond[var] end do_if(Person.new, proc{|person| person.name == 'John'}) do |person| puts person end but IMO that's not more efficient than allocating a temporal variable, except maybe for the persistence of the variable. Perhaps it has better uses.