-
-
Save anonymous/bb8ad54d52a92f8f98cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Feed < ActiveRecord::Base | |
attr_accessible :description, :item, :lastBuildDate, :link, :pubDate, :title | |
include FeedFetcher | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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