From f626aece793eab4a414eeb96a3bb3440e98e05d8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 9 Jan 2005 15:00:45 +0000 Subject: Added the first of the coming core extensions git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@349 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/core_ext/hash_ext.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 activesupport/lib/core_ext/hash_ext.rb (limited to 'activesupport/lib/core_ext/hash_ext.rb') diff --git a/activesupport/lib/core_ext/hash_ext.rb b/activesupport/lib/core_ext/hash_ext.rb new file mode 100644 index 0000000000..90670c42c7 --- /dev/null +++ b/activesupport/lib/core_ext/hash_ext.rb @@ -0,0 +1,6 @@ +class Hash + def assert_valid_keys(valid_keys) + unknown_keys = keys - valid_keys + raise(ArgumentError, "Unknown key(s): #{unknown_keys.join(", ")}") unless unknown_keys.empty? + end +end \ No newline at end of file -- cgit v1.2.3