Skip to content

Instantly share code, notes, and snippets.

@danielvlopes
Forked from jeffrydegrande/gist:664697
Created November 5, 2010 20:22
Show Gist options
  • Save danielvlopes/664730 to your computer and use it in GitHub Desktop.
Save danielvlopes/664730 to your computer and use it in GitHub Desktop.
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