Skip to content

Instantly share code, notes, and snippets.

/feed.rb Secret

Created March 8, 2013 20:00
Show Gist options
  • Save anonymous/bb8ad54d52a92f8f98cf to your computer and use it in GitHub Desktop.
Save anonymous/bb8ad54d52a92f8f98cf to your computer and use it in GitHub Desktop.
class Feed < ActiveRecord::Base
attr_accessible :description, :item, :lastBuildDate, :link, :pubDate, :title
include FeedFetcher
end
require 'feedzirra'
require 'celluloid'
class Feed
module FeedFetcher
extend ActiveSupport::Concern
include Celluloid
module ClassMethods
def fetchfeed(url)
feed = Feedzirra::Feed.fetch_and_parse(url)
p feed.title
end
end
end
end
[3] pry(main)> x = Feed.new
NameError: uninitialized constant Feed::FeedFetcher
from /Users/kingdom/codevault/katanawind/app/models/feed.rb:3:in `Feed'
[4] pry(main)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment