コード例 #1
0
ファイル: Processor.java プロジェクト: nawroth/asciidoctorj
 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);
 }
コード例 #2
0
ファイル: Processor.java プロジェクト: nawroth/asciidoctorj
  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);
  }