Sha256: 0212b3fed8a8b8be57c324eb71ab41c8d360b056b2b0c4354a9872591761d7a9
Contents?: true
Size: 488 Bytes
Versions: 3
Compression:
Stored size: 488 Bytes
Contents
class WikiOnThisDay::Snippet attr_accessor :year, :link_url, :text, :article_abstract def initialize(args) self.year = args[:year] if args[:year] self.link_url = args[:link_url] if args[:link_url] self.text = args[:text].gsub(/\W\(pictured\)/,'') if args[:text] self.article_abstract = WikiOnThisDay::Scraper.new(self.link_url).html_doc.css('div#mw-content-text > p').first.text if self.link_url end def print WikiOnThisDay::Printer.new(self).print end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
wiki_on_this_day-0.2.2 | lib/wiki_on_this_day/snippet.rb |
wiki_on_this_day-0.2.1 | lib/wiki_on_this_day/snippet.rb |
wiki_on_this_day-0.2.0 | lib/wiki_on_this_day/snippet.rb |