org.jruby.Ruby.getModule()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(220)

本文整理了Java中org.jruby.Ruby.getModule方法的一些代码示例,展示了Ruby.getModule的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.getModule方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:getModule

Ruby.getModule介绍

[英]Retrieve the module with the given name from the Object namespace.
[中]从对象命名空间中检索具有给定名称的模块。

代码示例

代码示例来源:origin: asciidoctor/asciidoctorj

  1. public Parser(Ruby runtime, StructuralNode parent, Reader reader) {
  2. super(runtime.getModule("Asciidoctor").getClass("Parser"));
  3. this.reader = reader;
  4. this.parent = parent;
  5. }

代码示例来源:origin: org.asciidoctor/asciidoctorj

  1. public Parser(Ruby runtime, StructuralNode parent, Reader reader) {
  2. super(runtime.getModule("Asciidoctor").getClass("Parser"));
  3. this.reader = reader;
  4. this.parent = parent;
  5. }

代码示例来源:origin: org.jruby/jruby-complete

  1. StructByValue(Ruby runtime, RubyClass structClass, StructLayout structLayout) {
  2. super(runtime, runtime.getModule("FFI").getClass("Type").getClass("Struct"),
  3. NativeType.STRUCT, structLayout.size, structLayout.alignment);
  4. this.structClass = structClass;
  5. this.structLayout = structLayout;
  6. }

代码示例来源:origin: org.jruby/jruby-complete

  1. public Symbol(Ruby runtime, DynamicLibrary library, String name, MemoryIO io) {
  2. super(runtime, runtime.getModule("FFI").getClass("DynamicLibrary").getClass("Symbol"),
  3. io, Long.MAX_VALUE);
  4. this.library = library;
  5. this.name = name;
  6. }

代码示例来源:origin: org.jruby/jruby-complete

  1. JFFIInvoker(Ruby runtime, long address, Type returnType, Type[] parameterTypes, CallingConvention convention) {
  2. this(runtime, runtime.getModule("FFI").getClass("Invoker"),
  3. new CodeMemoryIO(runtime, address),
  4. returnType, parameterTypes, convention, null);
  5. }

代码示例来源:origin: org.asciidoctor/asciidoctorj

  1. private RubyClass getConverterFactory() {
  2. return rubyRuntime.getModule("Asciidoctor")
  3. .defineOrGetModuleUnder("Converter")
  4. .getClass("Factory");
  5. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. StructByValue(Ruby runtime, RubyClass structClass, StructLayout structLayout) {
  2. super(runtime, runtime.getModule("FFI").getClass("Type").getClass("Struct"),
  3. NativeType.STRUCT, structLayout.size, structLayout.alignment);
  4. this.structClass = structClass;
  5. this.structLayout = structLayout;
  6. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. public Symbol(Ruby runtime, DynamicLibrary library, String name, MemoryIO io) {
  2. super(runtime, runtime.getModule("FFI").getClass("DynamicLibrary").getClass("Symbol"),
  3. io, Long.MAX_VALUE);
  4. this.library = library;
  5. this.name = name;
  6. }

代码示例来源:origin: asciidoctor/asciidoctorj

  1. private RubyClass getConverterFactory() {
  2. return rubyRuntime.getModule("Asciidoctor")
  3. .defineOrGetModuleUnder("Converter")
  4. .getClass("Factory");
  5. }

代码示例来源:origin: org.jruby/jruby-core

  1. StructByValue(Ruby runtime, RubyClass structClass, StructLayout structLayout) {
  2. super(runtime, runtime.getModule("FFI").getClass("Type").getClass("Struct"),
  3. NativeType.STRUCT, structLayout.size, structLayout.alignment);
  4. this.structClass = structClass;
  5. this.structLayout = structLayout;
  6. }

代码示例来源:origin: org.jruby/jruby-core

  1. JFFIInvoker(Ruby runtime, long address, Type returnType, Type[] parameterTypes, CallingConvention convention) {
  2. this(runtime, runtime.getModule("FFI").getClass("Invoker"),
  3. new CodeMemoryIO(runtime, address),
  4. returnType, parameterTypes, convention, null);
  5. }

代码示例来源:origin: org.jruby/jruby-complete

  1. public NativeCallbackFactory(Ruby runtime, CallbackInfo cbInfo) {
  2. this.runtime = runtime;
  3. this.closureInfo = newFunctionInfo(runtime, cbInfo);
  4. this.closurePool = com.kenai.jffi.ClosureManager.getInstance().getClosurePool(closureInfo.callContext);
  5. this.callbackInfo = cbInfo;
  6. this.callbackClass = runtime.getModule("FFI").getClass("Callback");
  7. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. final Type checkType(IRubyObject type) {
  2. if (!(type instanceof Type)) {
  3. throw getRuntime().newTypeError(type, getRuntime().getModule("FFI").getClass("Type"));
  4. }
  5. return (Type) type;
  6. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. private Enum(Ruby runtime, RubyClass klass) {
  2. super(runtime, klass);
  3. nativeType = runtime.getModule("FFI").getClass("Type").getConstant("INT");
  4. kv_map = RubyHash.newHash(runtime);
  5. tag = runtime.getNil();
  6. }

代码示例来源:origin: org.jruby/jruby-complete

  1. final Type checkType(IRubyObject type) {
  2. if (!(type instanceof Type)) {
  3. throw getRuntime().newTypeError(type, getRuntime().getModule("FFI").getClass("Type"));
  4. }
  5. return (Type) type;
  6. }

代码示例来源:origin: org.jruby/jruby-core

  1. final Type checkType(IRubyObject type) {
  2. if (!(type instanceof Type)) {
  3. throw getRuntime().newTypeError(type, getRuntime().getModule("FFI").getClass("Type"));
  4. }
  5. return (Type) type;
  6. }

代码示例来源:origin: asciidoctor/asciidoctorj

  1. static ReaderImpl createReader(Ruby runtime, List<String> lines) {
  2. RubyArray rubyLines = runtime.newArray(lines.size());
  3. for (String line : lines) {
  4. rubyLines.add(runtime.newString(line));
  5. }
  6. RubyClass readerClass = runtime.getModule("Asciidoctor").getClass("Reader");
  7. return new ReaderImpl(readerClass.callMethod("new", rubyLines));
  8. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. @Override
  2. @JRubyMethod(name="initialize", visibility = PRIVATE, required = 3, optional = 1)
  3. public final IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
  4. IRubyObject type = args[2];
  5. if (!(type instanceof CallbackInfo)) {
  6. throw context.runtime.newTypeError(type, context.runtime.getModule("FFI").getClass("Type").getClass("Function"));
  7. }
  8. init(args, FunctionFieldIO.INSTANCE);
  9. return this;
  10. }
  11. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. @Override
  2. @JRubyMethod(name="initialize", visibility = PRIVATE, required = 3, optional = 1)
  3. public final IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
  4. IRubyObject type = args[2];
  5. if (!(type instanceof CallbackInfo)) {
  6. throw context.runtime.newTypeError(type, context.runtime.getModule("FFI").getClass("Type").getClass("Function"));
  7. }
  8. init(args, FunctionFieldIO.INSTANCE);
  9. return this;
  10. }
  11. }

代码示例来源:origin: org.jruby/jruby-complete

  1. @Override
  2. @JRubyMethod(name="initialize", visibility = PRIVATE, required = 3, optional = 1)
  3. public final IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
  4. IRubyObject type = args[2];
  5. if (!(type instanceof CallbackInfo)) {
  6. throw context.runtime.newTypeError(type, context.runtime.getModule("FFI").getClass("Type").getClass("Function"));
  7. }
  8. init(args, FunctionFieldIO.INSTANCE);
  9. return this;
  10. }
  11. }

相关文章

Ruby类方法