another noob question… how do I add methods to a class such that
they can be access from the console and from rake?
I have a ruby script to fetch tweets from the search api. That works
fine, saves my tweets to the db. I have a separate, basic rails app to
view and manage the tweets and search queries. All of that works fine,
Now I want to integrate the script into the rails app so it:
-runs as a rake task
-runs from cron
-runs from a refresh button on the tweets page
The original ruby script has two methods: search_twitter and
get_tweets. I copied those into the Tweet controller, but I cannot
access them from the rake file or from the console. If I do
Tweet.methods from the console, neither method shows up.
So - where is the correct place for these methods, and how do I access
them from rake and the console?