-
-
Save cheald/eb1868ff80bc5ca7f144 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void validateKeywordArgs(ThreadContext context, RubyHash options, IRubyObject[] validKeys) { | |
RubyArray delta = (RubyArray)options.keys().op_diff(context.runtime.newArray(validKeys)); | |
for (int i = 0; i < delta.length().getIntValue(); i++) { | |
context.runtime.newArgumentError("unknown keyword: " + delta.at(context.runtime.newFixnum(i))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment