-
-
Save danielvlopes/664730 to your computer and use it in GitHub Desktop.
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
def self.guid_from_entry(entry) | |
[:guid, :url, :content, :summary].each do |sym| | |
next unless available_for_guid? entry | |
return Digest::MD5.hexdigest(entry.send(sym)) | |
end | |
end | |
def self.available_for_guid?(entry) | |
entry.respond_to?(sym) and entry.send(sym).present? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment