From: Stefan Rusterholz Date: 2007-09-04T07:01:21+09:00 Subject: Re: with Matthias W辰chter wrote: > Sorry folks if this was raised already, but google is not very > useful when asked for "ruby with" or "ruby map single object" ... > > > Is there something like "with" already available? Let me give the > short implementation first so the gurus know right away what I am after: > > module Kernel > def with > yield self > end > end > > What does it do? It can glue an object and a block together. Just > append ".with {|x| block}" to your object. What's that good for? > > *snip* (ruby-forum.com doesn't like too much quoted text) > > Thanks, > - Matthias Sometimes less is more ;-) I'm not sure I really undestood what you want, but maybe instance_eval is what you want or at least comes close to it. Regards Stefan -- Posted via http://www.ruby-forum.com/.