Method: MethodObject::ClassMethods#__check_for_unknown_options
- Defined in:
- lib/method_object.rb
#__check_for_unknown_options(*args, **kwargs) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/method_object.rb', line 31 def (*args, **kwargs) return if .empty? # Checking params opts = args.drop(__defined_params.length).first || kwargs raise ArgumentError, "Unexpected argument #{opts}" unless opts.is_a? Hash # Checking options = opts.keys - = "Key(s) #{unknown_options} not found in #{__defined_options}" raise KeyError, if .any? end |