Hi --
On Fri, 17 Jul 2009, Wes Gamble wrote:
>
> I'm using Rails 2.1.2 at the moment.
>
> So I need to reliably call a private method dynamically, and I don't
> want to have to change how I do it when I move to Rails 2.3.2 nor Ruby
> 1.9.
>
> Should I use Object#send or something else?
Object#send (or __send__, if you like that one) should be fine. It
looks like Rails's send! is just an alias. From ActiveSupport:
class Object
unless respond_to?(:send!)
# Anticipating Ruby 1.9 neutering send
alias send! send
end
"Neutered" meaning that it won't call private methods, I assume -- but
that decision was rescinded.
David
--
David A. Black / Ruby Power and Light, LLC
Ruby/Rails consulting & training: http://www.rubypal.com
Now available: The Well-Grounded Rubyist (http://manning.com/black2)
Training! Intro to Ruby, with Black & Kastner, September 14-17
(More info: http://rubyurl.com/vmzN)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---