public static IRubyObject asRubyObject(Object o) { if (o instanceof IRubyObject) { return (IRubyObject) o; } else if (o instanceof RubyObjectHolderProxy) { return ((RubyObjectHolderProxy) o).__ruby_object(); } else { throw new IllegalArgumentException(o.getClass() + " is not a IRubyObject nor a RubyObjectHolderProxy!"); } } }
public static IRubyObject asRubyObject(Object o) { if (o instanceof IRubyObject) { return (IRubyObject) o; } else if (o instanceof RubyObjectHolderProxy) { return ((RubyObjectHolderProxy) o).__ruby_object(); } else { throw new IllegalArgumentException(o.getClass() + " is not a IRubyObject nor a RubyObjectHolderProxy!"); } } }
public static Ruby get(ContentNode node) { if (node instanceof IRubyObject) { return ((IRubyObject) node).getRuntime(); } else if (node instanceof RubyObjectHolderProxy) { return ((RubyObjectHolderProxy) node).__ruby_object().getRuntime(); } else if (node instanceof ContentNodeImpl) { IRubyObject nodeDelegate = ((ContentNodeImpl) node).getRubyObject(); return nodeDelegate.getRuntime(); } else { throw new IllegalArgumentException("Don't know what to with a " + node); } }
public static Ruby get(ContentNode node) { if (node instanceof IRubyObject) { return ((IRubyObject) node).getRuntime(); } else if (node instanceof RubyObjectHolderProxy) { return ((RubyObjectHolderProxy) node).__ruby_object().getRuntime(); } else if (node instanceof ContentNodeImpl) { IRubyObject nodeDelegate = ((ContentNodeImpl) node).getRubyObject(); return nodeDelegate.getRuntime(); } else { throw new IllegalArgumentException("Don't know what to with a " + node); } }
public static IRubyObject trySimpleConversions(Ruby runtime, Object object) { if ( object == null ) return runtime.getNil(); if ( object instanceof IRubyObject ) return (IRubyObject) object; if ( object instanceof RubyObjectHolderProxy ) { return ((RubyObjectHolderProxy) object).__ruby_object(); } if ( object instanceof InternalJavaProxy ) { final InternalJavaProxy internalJavaProxy = (InternalJavaProxy) object; IRubyObject orig = internalJavaProxy.___getInvocationHandler().getOrig(); if (orig != null) return orig; } return null; }
public static IRubyObject trySimpleConversions(Ruby runtime, Object object) { if ( object == null ) return runtime.getNil(); if ( object instanceof IRubyObject ) return (IRubyObject) object; if ( object instanceof RubyObjectHolderProxy ) { return ((RubyObjectHolderProxy) object).__ruby_object(); } if ( object instanceof InternalJavaProxy ) { final InternalJavaProxy internalJavaProxy = (InternalJavaProxy) object; IRubyObject orig = internalJavaProxy.___getInvocationHandler().getOrig(); if (orig != null) return orig; } return null; }
private static IRubyObject trySimpleConversions(Ruby runtime, Object object) { if (object == null) { return runtime.getNil(); } if (object instanceof IRubyObject) { return (IRubyObject) object; } if (object instanceof RubyObjectHolderProxy) { return ((RubyObjectHolderProxy) object).__ruby_object(); } if (object instanceof InternalJavaProxy) { InternalJavaProxy internalJavaProxy = (InternalJavaProxy) object; IRubyObject orig = internalJavaProxy.___getInvocationHandler().getOrig(); if (orig != null) { return orig; } } return null; }
private static IRubyObject trySimpleConversions(Ruby runtime, Object object) { if (object == null) { return runtime.getNil(); } if (object instanceof IRubyObject) { return (IRubyObject) object; } if (object instanceof RubyObjectHolderProxy) { return ((RubyObjectHolderProxy) object).__ruby_object(); } if (object instanceof InternalJavaProxy) { InternalJavaProxy internalJavaProxy = (InternalJavaProxy) object; IRubyObject orig = internalJavaProxy.___getInvocationHandler().getOrig(); if (orig != null) { return orig; } } return null; }