Class: Hash

Inherits:
Object show all
Defined in:
lib/mongo/util/core_ext.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#assert_valid_keys(*valid_keys) ⇒ Object

:nodoc:

Raises:

  • (ArgumentError)


45
46
47
48
# File 'lib/mongo/util/core_ext.rb', line 45

def assert_valid_keys(*valid_keys)
  unknown_keys = keys - [valid_keys].flatten
  raise(ArgumentError, "Unknown key(s): #{unknown_keys.join(", ")}") unless unknown_keys.empty?
end