private Block createBlock(AbstractBlock parent, String context, Map<String, Object> options) { IRubyObject rubyClass = rubyRuntime.evalScriptlet("Asciidoctor::Block"); RubyHash convertMapToRubyHashWithSymbols = RubyHashUtil.convertMapToRubyHashWithSymbols(rubyRuntime, options); Object[] parameters = { parent.delegate(), RubyUtils.toSymbol(rubyRuntime, context), convertMapToRubyHashWithSymbols }; return (Block) JavaEmbedUtils.invokeMethod(rubyRuntime, rubyClass, "new", parameters, Block.class); }
public Inline createInline( AbstractBlock parent, String context, String text, Map<String, Object> attributes, Map<String, Object> options) { options.put(Options.ATTRIBUTES, attributes); IRubyObject rubyClass = rubyRuntime.evalScriptlet("Asciidoctor::Inline"); RubyHash convertMapToRubyHashWithSymbols = RubyHashUtil.convertMapToRubyHashWithSymbols(rubyRuntime, options); Object[] parameters = { parent.delegate(), RubyUtils.toSymbol(rubyRuntime, context), text, convertMapToRubyHashWithSymbols }; return (Inline) JavaEmbedUtils.invokeMethod(rubyRuntime, rubyClass, "new", parameters, Inline.class); }