Skip to content

Instantly share code, notes, and snippets.

@ekampp
Created April 3, 2013 23:36
Show Gist options
  • Save ekampp/5306453 to your computer and use it in GitHub Desktop.
Save ekampp/5306453 to your computer and use it in GitHub Desktop.
My hash class extensions. Currently it contains a nice `compact` method for purging blank values from the hash.
class Hash
def compact
self.select{|k,v| !v.blank? }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment