I am pretty sure that Ruby has these (equivalents for __call, __get and __set), because otherwise how find_by would work in Rails? Maybe someone could give a quick example of how to define methods that act same as find_by?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The dynamic finders are done by implementing method missing
http://ruby-doc.org/core/classes/Kernel.html#M005925
Take a look at this blog post, it will give you the gist of how they work..
http://blog.hasmanythrough.com/2006/8/13/how-dynamic-finders-work