33 package com.google.protobuf.jruby;
36 import org.jruby.RubyModule;
37 import org.jruby.RubyNumeric;
38 import org.jruby.anno.JRubyMethod;
39 import org.jruby.runtime.ThreadContext;
40 import org.jruby.runtime.builtin.IRubyObject;
50 @JRubyMethod(meta =
true)
51 public static IRubyObject
lookup(ThreadContext context, IRubyObject recv, IRubyObject
number) {
55 if (
value ==
null)
return context.runtime.getNil();
56 return context.runtime.newSymbol(
value.getName());
66 @JRubyMethod(meta =
true)
67 public static IRubyObject
resolve(ThreadContext context, IRubyObject recv, IRubyObject
name) {
71 if (
value ==
null)
return context.runtime.getNil();
72 return context.runtime.newFixnum(
value.getNumber());
82 @JRubyMethod(meta =
true,
name =
"descriptor")
83 public static IRubyObject
getDescriptor(ThreadContext context, IRubyObject recv) {