How to store Ruby method references in a database?

Posted by Mad Wombat on Stack Overflow See other posts from Stack Overflow or by Mad Wombat
Published on 2010-04-08T23:59:52Z Indexed on 2010/04/09 0:03 UTC
Read the original article Hit count: 572

Filed under:
|
|

I am writing my first rails app. It needs to aggregate some data from multiple sites and for each site I have a unique way of getting the data (some provide RSS, some JSON, for some I scrape the HTML etc.). These will run on schedule, probably as a rake task from cron. It seems logical to store the sites and relevant information in a model, but I am not sure where to put unique data retrieval methods. Do I store method names in the model? Do I just name the methods the same as site name and call them that way? Basically, I need a way to read a list of sites and call appropriate method for each site. What is the Ruby on Rails way to do it?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby