lib/wiki/article.rb in wiki-yggdrasil-0.3.2 vs lib/wiki/article.rb in wiki-yggdrasil-0.4.0
- old
+ new
@@ -10,13 +10,18 @@
raise ArgumentError unless Wiki::Yggdrasil::Article.is_valid_wiki_article?(uri: uri)
@uri = uri
@summary = nil
@child_links = nil
@name = nil
+ @checksum = nil
end
def summary
@summary ||= Nokogiri::HTML(Nokogiri::HTML(open(self.uri)).to_s.split('<div id="toc" class="toc">')[0]).css('p') ## TODO: Cleanup
+ end
+
+ def checksum
+ Digest::MD5.hexdigest(@summary.to_s)
end
def child_links(help: false)
formatted_links = format_links
validated_links = formatted_links.select { |uri| Wiki::Yggdrasil::Article.is_valid_wiki_article?(uri: uri) }