Created
January 26, 2014 23:04
-
-
Save laser/8640652 to your computer and use it in GitHub Desktop.
RSS Importer - less state
This file contains hidden or 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 RssImporter | |
def self.import(articles) | |
articles.map do |article| | |
RssContent.create { url: article.url, text: article.body } | |
end | |
end | |
end | |
# somewhere in your codebase... | |
imported = RssImporter.import a_bunch_of_rss_content |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment