forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRubyObjectAdapter.java
More file actions
37 lines (22 loc) · 1.15 KB
/
Copy pathRubyObjectAdapter.java
File metadata and controls
37 lines (22 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package org.jruby;
import org.jruby.runtime.Block;
import org.jruby.runtime.builtin.IRubyObject;
/**
*
* @author nicksieger
*/
public interface RubyObjectAdapter {
boolean isKindOf(IRubyObject value, RubyModule rubyModule);
IRubyObject setInstanceVariable(IRubyObject obj, String variableName, IRubyObject value);
IRubyObject[] convertToJavaArray(IRubyObject array);
RubyInteger convertToRubyInteger(IRubyObject obj);
IRubyObject getInstanceVariable(IRubyObject obj, String variableName);
RubyString convertToRubyString(IRubyObject obj);
// These call* assume ThreadContext = receiver.getRuntime().getCurrentContext()
IRubyObject callMethod(IRubyObject receiver, String methodName);
IRubyObject callMethod(IRubyObject receiver, String methodName, IRubyObject singleArg);
IRubyObject callMethod(IRubyObject receiver, String methodName, IRubyObject[] args);
IRubyObject callMethod(IRubyObject receiver, String methodName, IRubyObject[] args, Block block);
IRubyObject callSuper(IRubyObject receiver, IRubyObject[] args);
IRubyObject callSuper(IRubyObject receiver, IRubyObject[] args, Block block);
}