Skip to content

Instantly share code, notes, and snippets.

@jeffrydegrande
Created November 5, 2010 20:24
Show Gist options
  • Save jeffrydegrande/664734 to your computer and use it in GitHub Desktop.
Save jeffrydegrande/664734 to your computer and use it in GitHub Desktop.
def self.guid_from_entry(entry)
def entry.available_for_guid?(sym)
respond_to?(sym) && send(sym).present?
end
[:guid, :url, :content, :summary].each do |sym|
entry.available_for_guid?(sym) and return Digest::MD5.hexdigest(entry.send(sym))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment