Skip to content

Instantly share code, notes, and snippets.

@guimello
Created June 5, 2010 02:57
Show Gist options
  • Save guimello/426246 to your computer and use it in GitHub Desktop.
Save guimello/426246 to your computer and use it in GitHub Desktop.
additional methods for hash (easy to work on rspec)
class Hash
#for overriding keys
alias :with :merge
# for excluding keys
def except(*exclusions)
self.reject { |key, value| exclusions.include? key.to_sym }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment