Skip to content

Instantly share code, notes, and snippets.

@zachhale
Created November 3, 2009 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachhale/225382 to your computer and use it in GitHub Desktop.
Save zachhale/225382 to your computer and use it in GitHub Desktop.
class Hash
def requires!(*args)
args.flatten.each do |arg|
raise ArgumentError, "#{arg} is required" unless has_key?(arg)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment