In the RoR book by Dave following code is there in list.rhtml <% for column in Product.content_columns %> <td><%=h product.send(column.name) %></td> <% end %> Where is this method named ''send'' defined. I also looked at the documentation for ActiveRecord::Base but couldn''t find any info regarding ''send''. Thanks. - Neeraj
On Jul 22, 2005, at 12:35 PM, Neeraj Kumar wrote:> In the RoR book by Dave following code is there in list.rhtml > > <% for column in Product.content_columns %> > <td><%=h product.send(column.name) %></td> > <% end %> > > > > Where is this method named ''send'' defined. I also looked at the > documentation for ActiveRecord::Base but couldn''t find any info > regarding ''send''. > > Thanks. > - NeerajSend is part of Ruby. foo.send(:bar) is the same as foo.bar See http://www.ruby-doc.org/core/classes/Object.html#M000947 -Scott _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
* Neeraj Kumar [2005-07-22 12:35]:> > Where is this method named ''send'' defined. I also looked at the > documentation for ActiveRecord::Base but couldn''t find any info > regarding ''send''. >It''s a core ruby method: http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_object.html#Object.send -- ________________________________ toddgrimason*todd[ at ]slack.net
Le vendredi 22 juillet 2005 à 12:35 -0400, Neeraj Kumar a écrit :> Where is this method named ''send'' defined. I also looked at the > documentation for ActiveRecord::Base but couldn''t find any info > regarding ''send''.send method is not rails specific, it''s a Ruby method. Documentation for this method is available here : http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_object.html#Object.send Bye. -- Nicolas Cavigneaux | GPG KeyID : CFE76D24 nico-DRabjd/C3MEdnm+yROfE0A@public.gmane.org | http://www.bounga.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails