Class: Hash

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

Overview

:nodoc:

Direct Known Subclasses

BSON::OrderedHash

Instance Method Summary (collapse)

Instance Method Details

- (Object) assert_valid_keys(*valid_keys)

: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