本文整理了Java中org.jruby.Ruby.getData
方法的一些代码示例,展示了Ruby.getData
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.getData
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:getData
暂无
代码示例来源:origin: org.jruby/jruby-complete
public static void createAddrinfo(Ruby runtime) {
RubyClass addrinfo = runtime.defineClass(
"Addrinfo",
runtime.getData(),
new ObjectAllocator() {
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
return new Addrinfo(runtime, klazz);
}
});
addrinfo.defineAnnotatedMethods(Addrinfo.class);
}
代码示例来源:origin: org.jruby/jruby-core
public static void createAddrinfo(Ruby runtime) {
RubyClass addrinfo = runtime.defineClass(
"Addrinfo",
runtime.getData(),
new ObjectAllocator() {
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
return new Addrinfo(runtime, klazz);
}
});
addrinfo.defineAnnotatedMethods(Addrinfo.class);
}
代码示例来源:origin: org.jruby/jruby-complete
public static void createIfaddr(Ruby runtime) {
RubyClass ifaddr = runtime.getClass("Socket").defineClassUnder(
"Ifaddr",
runtime.getData(),
new ObjectAllocator() {
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
return new Ifaddr(runtime, klazz);
}
});
ifaddr.defineAnnotatedMethods(Ifaddr.class);
}
代码示例来源:origin: org.jruby/jruby-core
public static void createIfaddr(Ruby runtime) {
RubyClass ifaddr = runtime.getClass("Socket").defineClassUnder(
"Ifaddr",
runtime.getData(),
new ObjectAllocator() {
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
return new Ifaddr(runtime, klazz);
}
});
ifaddr.defineAnnotatedMethods(Ifaddr.class);
}
代码示例来源:origin: org.jruby/jruby-complete
public static RubyClass createConverterClass(Ruby runtime) {
RubyClass converterc = runtime.defineClassUnder("Converter", runtime.getData(), CONVERTER_ALLOCATOR, runtime.getEncoding());
runtime.setConverter(converterc);
converterc.setClassIndex(ClassIndex.CONVERTER);
converterc.setReifiedClass(RubyConverter.class);
converterc.kindOf = new RubyModule.JavaClassKindOf(RubyConverter.class);
converterc.defineAnnotatedMethods(RubyConverter.class);
converterc.defineAnnotatedConstants(RubyConverter.class);
return converterc;
}
代码示例来源:origin: org.jruby/jruby-core
public static RubyClass createConverterClass(Ruby runtime) {
RubyClass converterc = runtime.defineClassUnder("Converter", runtime.getData(), CONVERTER_ALLOCATOR, runtime.getEncoding());
runtime.setConverter(converterc);
converterc.setClassIndex(ClassIndex.CONVERTER);
converterc.setReifiedClass(RubyConverter.class);
converterc.kindOf = new RubyModule.JavaClassKindOf(RubyConverter.class);
converterc.defineAnnotatedMethods(RubyConverter.class);
converterc.defineAnnotatedConstants(RubyConverter.class);
return converterc;
}
代码示例来源:origin: org.jruby/jruby-complete
public static RubyClass createStringIOClass(final Ruby runtime) {
RubyClass stringIOClass = runtime.defineClass(
"StringIO", runtime.getData(), STRINGIO_ALLOCATOR);
stringIOClass.defineAnnotatedMethods(StringIO.class);
stringIOClass.includeModule(runtime.getEnumerable());
if (runtime.getObject().isConstantDefined("Java")) {
stringIOClass.defineAnnotatedMethods(IOJavaAddons.AnyIO.class);
}
RubyModule genericReadable = runtime.getIO().defineOrGetModuleUnder("GenericReadable");
genericReadable.defineAnnotatedMethods(GenericReadable.class);
stringIOClass.includeModule(genericReadable);
RubyModule genericWritable = runtime.getIO().defineOrGetModuleUnder("GenericWritable");
genericWritable.defineAnnotatedMethods(GenericWritable.class);
stringIOClass.includeModule(genericWritable);
return stringIOClass;
}
代码示例来源:origin: org.jruby/jruby-core
public static RubyClass createStringIOClass(final Ruby runtime) {
RubyClass stringIOClass = runtime.defineClass(
"StringIO", runtime.getData(), STRINGIO_ALLOCATOR);
stringIOClass.defineAnnotatedMethods(StringIO.class);
stringIOClass.includeModule(runtime.getEnumerable());
if (runtime.getObject().isConstantDefined("Java")) {
stringIOClass.defineAnnotatedMethods(IOJavaAddons.AnyIO.class);
}
RubyModule genericReadable = runtime.getIO().defineOrGetModuleUnder("GenericReadable");
genericReadable.defineAnnotatedMethods(GenericReadable.class);
stringIOClass.includeModule(genericReadable);
RubyModule genericWritable = runtime.getIO().defineOrGetModuleUnder("GenericWritable");
genericWritable.defineAnnotatedMethods(GenericWritable.class);
stringIOClass.includeModule(genericWritable);
return stringIOClass;
}
内容来源于网络,如有侵权,请联系作者删除!