Skip to content

Instantly share code, notes, and snippets.

@laser
Created January 26, 2014 23:04
Show Gist options
  • Save laser/8640652 to your computer and use it in GitHub Desktop.
Save laser/8640652 to your computer and use it in GitHub Desktop.
RSS Importer - less state
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