Created
April 3, 2013 23:36
-
-
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.
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
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