Package org.jruby.api
Class Check
java.lang.Object
org.jruby.api.Check
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RubyString
checkEmbeddedNulls
(ThreadContext context, IRubyObject obj) Check to see if the supplied object (which is convertable to a string) contains any null (\0) bytes.static RubySymbol
checkID
(ThreadContext context, IRubyObject obj) Convert the supplied object into an internal identifier String.
-
Constructor Details
-
Check
public Check()
-
-
Method Details
-
checkEmbeddedNulls
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
- the current thread contextobj
- object to be made into a string and checked for NULLs- Returns:
- the converted str (or original if no conversion happened).
-
checkID
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.
-