From: Bill Atkins Date: 2004-11-18T03:21:11+09:00 Subject: Re: block-ish expression? m(a, b, Class.new { def test; 13; end }.new) On Thu, 18 Nov 2004 03:13:15 +0900, itsme213 wrote: > I would like to conveniently create objects and define their methods right > at the point where I want to pass them into a method call. These objects are > a lot like blocks, except that I need more than one interface on them. > > === with a block > m(a, b) { |x| ... } > def m(a, b) > yield > end > > ==== what I want > m(a, b, ) > > def m(a, b, c) > if c.foo ... > c.bar ... > end > > Is there some convenient way to do this? > > Thanks! > >