On Jan 8, 2008 3:56 PM, Francois Wurmus <[EMAIL PROTECTED]> wrote:
> Chris Olsen schrieb:
> > Will obj.send(:method) work in 1.9 or is it saying that the send call
> > requires 2 params, the method and the object reference?
> >
> obj.send(:method) will work for non-private methods and send! works for
> private methods.

I'm pretty sure that Matz backed this difference out between 1.8 and
1.9, he took out some of these things before the Christmas release of
1.9.0

Object#send will work for private methods as it always did, and
Object#send! is no longer there.

> additionally there is send() without a receiving object. that is the
> only of those methods requiring two parameters.

There's no such thing as a method call without a receiving object in Ruby

  send(:foo)

is the same as

  self.send(:foo)

Object#send takes an arbitrary number of arguments, the first argument
is the method selector, the rest are used as arguments to the method
being called.

-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to