Top Constructors Methods
org.jruby.api

public Class Check

extends Object
Class Inheritance
Imports
org.jruby.RubyString, .RubySymbol, org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static RubyString

Returns:

the converted str (or original if no conversion happened).
checkEmbeddedNulls
(ThreadContext
the current thread context
context
,
IRubyObject
object to be made into a string and checked for NULLs
obj
)

Check to see if the supplied object (which is convertable to a string) contains any null (\0) bytes.

public static RubySymbol
checkID(ThreadContext context, IRubyObject obj)

Convert the supplied object into an internal identifier String.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Checkback to summary
public Check()

Method Detail

checkEmbeddedNullsback to summary
public static RubyString checkEmbeddedNulls(ThreadContext context, IRubyObject obj)

Check to see if the supplied object (which is convertable to a string) contains any null (\0) bytes. It will throw an ArgumentError if so and a TypeError is obj is not a string{able}.

Parameters
context:ThreadContext

the current thread context

obj:IRubyObject

object to be made into a string and checked for NULLs

Returns:RubyString

the converted str (or original if no conversion happened).

checkIDback to summary
public static RubySymbol checkID(ThreadContext context, IRubyObject obj)

Convert the supplied object into an internal identifier String. Basically, symbols are stored internally as raw bytes from whatever encoding they were originally sourced from. When methods are stored they must also get stored in this same raw fashion so that if we use symbols to look up methods or make symbols from these method names they will match up. For 2.2 compatibility, we also force all incoming identifiers to get anchored as hard-referenced symbols.