-
-
Save yorickpeterse/df4b33859869d26c4cf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.libll; | |
import org.jruby.Ruby; | |
import org.jruby.RubyModule; | |
import org.jruby.RubyClass; | |
import org.jruby.RubyObject; | |
import org.jruby.RubyArray; | |
import org.jruby.anno.JRubyClass; | |
import org.jruby.anno.JRubyMethod; | |
import org.jruby.runtime.ThreadContext; | |
import org.jruby.runtime.ObjectAllocator; | |
import org.jruby.runtime.builtin.IRubyObject; | |
@JRubyClass(name="LL::DriverConfig", parent="Object") | |
public class DriverConfig extends RubyObject | |
{ | |
private Ruby runtime; | |
/** | |
* Sets up the class in the Ruby runtime. | |
*/ | |
public static void load(Ruby runtime) | |
{ | |
RubyModule ll = (RubyModule) runtime.getModule("LL"); | |
RubyClass config = ll.defineClassUnder( | |
"DriverConfig", | |
runtime.getObject(), | |
ALLOCATOR | |
); | |
config.defineAnnotatedMethods(DriverConfig.class); | |
} | |
private static final ObjectAllocator ALLOCATOR = new ObjectAllocator() | |
{ | |
public IRubyObject allocate(Ruby runtime, RubyClass klass) | |
{ | |
return new org.libll.DriverConfig(runtime, klass); | |
} | |
}; | |
public DriverConfig(Ruby runtime, RubyClass klass) | |
{ | |
super(runtime, klass); | |
this.runtime = runtime; | |
} | |
@JRubyMethod(name="tokens_native=") | |
public IRubyObject set_tokens_native(ThreadContext context, RubyArray array) | |
{ | |
return context.nil; | |
} | |
@JRubyMethod(name="rules_native=") | |
public IRubyObject set_rules_native(ThreadContext context, RubyArray array) | |
{ | |
return context.nil; | |
} | |
@JRubyMethod(name="table_native=") | |
public IRubyObject set_table_native(ThreadContext context, RubyArray array) | |
{ | |
return context.nil; | |
} | |
@JRubyMethod(name="actions_native=") | |
public IRubyObject set_actions_native(ThreadContext context, RubyArray array) | |
{ | |
return context.nil; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment