Logo Search packages:      
Sourcecode: jruby1.1 version File versions

String org::jruby::RubyObject::asJavaString (  )  [inline, inherited]


Will try to convert this object to a String using the Ruby "to_str" if the object isn't already a String. If this still doesn't work, will throw a Ruby TypeError.

Implements org::jruby::runtime::builtin::IRubyObject.

Reimplemented in org::jruby::RubyFixnum, org::jruby::RubyString, and org::jruby::RubySymbol.

Definition at line 749 of file RubyObject.java.

References org::jruby::runtime::builtin::IRubyObject::isNil().

        IRubyObject asString = checkStringType();
        if(!asString.isNil()) return ((RubyString)asString).asJavaString();
        throw getRuntime().newTypeError(inspect().toString() + " is not a symbol");

Generated by  Doxygen 1.6.0   Back to index