On Tue, 14 Mar 2006, Wes G. wrote:
I can’t find it on ActiveRecord::Base? I assume that it returns a
value based on the column id but I can’t find any documentation on it.
send sends a message to an object. In this case, you’re sending the
name of the column to the object in target_list.
Sending a message is basically equivalent to calling a method. But
since you don’t know the name(s) of the methods in advance (they’re in
the columns), you use send to generalize the process.
It’s a built-in Ruby facility; it’s used in many programs and systems,
not just Rails.
David A. Black (email@example.com)
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)
“Ruby for Rails” chapters now available
from Manning Early Access Program! http://www.manning.com/books/black