org.mentawai.jruby
Class JRubyWrapper

java.lang.Object
  extended by org.mentawai.jruby.JRubyWrapper

public class JRubyWrapper
extends Object

A simple wrapper class to encapsulate a Ruby object and make calls to it through a JRubyInterpreter.

Author:
Sergio Oliveira Jr.
See Also:
JRubyInterpreter

Constructor Summary
JRubyWrapper(org.jruby.RubyObject rubyObject)
          Creates a JRubyWrapper for the ruby object passed.
 
Method Summary
 Object call(String methodName)
           
 Object call(String methodName, Class<? extends Object> returnType)
           
 Object call(String methodName, Class<? extends Object> returnType, Object... params)
           
 Object call(String methodName, Object... params)
           
 Object callStatic(String methodName)
           
 Object callStatic(String methodName, Class<? extends Object> returnType)
           
 Object callStatic(String methodName, Class<? extends Object> returnType, Object... params)
           
 Object callStatic(String methodName, Object... params)
           
 Object getRubyObject()
          Gets the ruby object of this wrapper.
 boolean respondTo(String methodName)
           
 Object set(String propName, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRubyWrapper

public JRubyWrapper(org.jruby.RubyObject rubyObject)
Creates a JRubyWrapper for the ruby object passed.

Parameters:
rubyObject - The ruby object to encapsulate
Method Detail

call

public Object call(String methodName)

call

public Object call(String methodName,
                   Class<? extends Object> returnType)

call

public Object call(String methodName,
                   Class<? extends Object> returnType,
                   Object... params)

call

public Object call(String methodName,
                   Object... params)

callStatic

public Object callStatic(String methodName)

callStatic

public Object callStatic(String methodName,
                         Class<? extends Object> returnType)

callStatic

public Object callStatic(String methodName,
                         Class<? extends Object> returnType,
                         Object... params)

callStatic

public Object callStatic(String methodName,
                         Object... params)

respondTo

public boolean respondTo(String methodName)

set

public Object set(String propName,
                  Object value)

getRubyObject

public Object getRubyObject()
Gets the ruby object of this wrapper.

Returns:
The ruby object


Copyright © 2013. All Rights Reserved.