Skip to content

Instantly share code, notes, and snippets.

@enebo
Created April 13, 2019 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enebo/dfbeb603b137b89e647ef6853efe6623 to your computer and use it in GitHub Desktop.
Save enebo/dfbeb603b137b89e647ef6853efe6623 to your computer and use it in GitHub Desktop.
@JRubyModule(name = "Oj")
public class RubyOj extends RubyModule {
// ...
@JRubyMethod(module = true, required = 1, rest = true)
public static IRubyObject strict_load(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) {
OjLibrary oj = resolveOj(self);
Options options = oj.default_options.dup(context);
ParserSource source = processArgs(context, args, options);
return new StrictParse(source, context, options).parse(oj, true, block);
}
public static OjLibrary resolveOj(IRubyObject self) {
return (OjLibrary) self.getInternalVariables().getInternalVariable("_oj");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment